home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / recent / warpup1.lha / WarpUP-WarpOS / Docs / powerpc.doc < prev    next >
Text File  |  1998-04-04  |  103KB  |  3,535 lines

  1. TABLE OF CONTENTS
  2.  
  3. powerpc.library/AllocVec32
  4. powerpc.library/AllocXMsg
  5. powerpc.library/FreeVec32
  6. powerpc.library/FreeXMsg
  7. powerpc.library/GetCPU
  8. powerpc.library/GetPPCState
  9. powerpc.library/PowerDebugMode
  10. powerpc.library/PutXMsg
  11. powerpc.library/RunPPC
  12. powerpc.library/SPrintF68K
  13. powerpc.library/WaitForPPC
  14.  
  15. powerpc.library/AddHeadPPC
  16. powerpc.library/AddPortPPC
  17. powerpc.library/AddSemaphorePPC
  18. powerpc.library/AddTailPPC
  19. powerpc.library/AddTimePPC
  20. powerpc.library/AllocSignalPPC
  21. powerpc.library/AllocVecPPC
  22. powerpc.library/AllocXMsgPPC
  23. powerpc.library/AttemptSemaphorePPC
  24. powerpc.library/ChangeMMU
  25. powerpc.library/ClearExcMMU
  26. powerpc.library/CmpTimePPC
  27. powerpc.library/CopyMemPPC
  28. powerpc.library/CreateMsgPortPPC
  29. powerpc.library/CreateTaskPPC
  30. powerpc.library/DeleteMsgPortPPC
  31. powerpc.library/DeleteTaskPPC
  32. powerpc.library/EndSnoopTask
  33. powerpc.library/EnqueuePPC
  34. powerpc.library/FindNamePPC
  35. powerpc.library/FindPortPPC
  36. powerpc.library/FindSemaphorePPC
  37. powerpc.library/FindTagItemPPC
  38. powerpc.library/FindTaskByID
  39. powerpc.library/FindTaskPPC
  40. powerpc.library/FreeAllMem
  41. powerpc.library/FreeSemaphorePPC
  42. powerpc.library/FreeSignalPPC
  43. powerpc.library/FreeVecPPC
  44. powerpc.library/FreeXMsgPPC
  45. powerpc.library/GetHALInfo
  46. powerpc.library/GetInfo
  47. powerpc.library/GetMsgPPC
  48. powerpc.library/GetSysTimePPC
  49. powerpc.library/GetTagDataPPC
  50. powerpc.library/InitSemaphorePPC
  51. powerpc.library/InsertPPC
  52. powerpc.library/LockTaskList
  53. powerpc.library/ModifyFPExc
  54. powerpc.library/NextTagItemPPC
  55. powerpc.library/ObtainSemaphorePPC
  56. powerpc.library/PutMsgPPC
  57. powerpc.library/PutXMsgPPC
  58. powerpc.library/ReleaseSemaphorePPC
  59. powerpc.library/RemExcHandler
  60. powerpc.library/RemHeadPPC
  61. powerpc.library/RemovePPC
  62. powerpc.library/RemPortPPC
  63. powerpc.library/RemTailPPC
  64. powerpc.library/RemSemaphorePPC
  65. powerpc.library/ReplyMsgPPC
  66. powerpc.library/Run68K
  67. powerpc.library/SetCache
  68. powerpc.library/SetExcHandler
  69. powerpc.library/SetExcMMU
  70. powerpc.library/SetHardware
  71. powerpc.library/SetNiceValue
  72. powerpc.library/SetReplyPortPPC
  73. powerpc.library/SetScheduling
  74. powerpc.library/SetSignalPPC
  75. powerpc.library/SetTaskPriPPC
  76. powerpc.library/Signal68K
  77. powerpc.library/SignalPPC
  78. powerpc.library/SnoopTask
  79. powerpc.library/SPrintF
  80. powerpc.library/SubTimePPC
  81. powerpc.library/Super
  82. powerpc.library/UnLockTaskList
  83. powerpc.library/User
  84. powerpc.library/WaitFor68K
  85. powerpc.library/WaitPortPPC
  86. powerpc.library/WaitPPC
  87. powerpc.library/WaitTime
  88.  
  89. powerpc.library/AllocVec32                          powerpc.library/AllocVec32
  90.  
  91.     NAME
  92.     AllocVec32 - allocates memory which is correctly aligned (V7)
  93.  
  94.     CPU
  95.     680x0
  96.  
  97.     SYNOPSIS
  98.     memblock = AllocVec32(memsize, attributes)
  99.     d0                    d0       d1
  100.  
  101.     void *AllocVec32(ULONG, ULONG);
  102.  
  103.     FUNCTION
  104.     This function allocates memory via exec/AllocVec and aligns the
  105.     memory block properly, so that this memory block can be shared
  106.     with PPC tasks. The minimal alignment of the memory block is 32.
  107.  
  108.     INPUTS
  109.     memsize - size of memory to be allocated
  110.     attributes - the desired memory attributes (see exec/AllocMem for
  111.              a description of these attributes)
  112.  
  113.     RESULT
  114.     memblock - The address of the allocated memory block
  115.  
  116.     NOTES
  117.     Memory blocks allocated with 'AllocVec32' must be freed using
  118.     'FreeVec32'.
  119.  
  120.     SEE ALSO
  121.     FreeVec32, exec/AllocMem
  122.  
  123. powerpc.library/AllocXMsg                            powerpc.library/AllocXMsg
  124.  
  125.     NAME
  126.     AllocXMsg - allocates a message for Inter-CPU communication (V12)
  127.  
  128.     CPU
  129.     680x0
  130.  
  131.     SYNOPSIS
  132.     message = AllocXMsg(bodysize, replyport)
  133.     d0                  d0        a0
  134.  
  135.     struct Message *AllocXMsg(ULONG, struct MsgPort *);
  136.  
  137.     FUNCTION
  138.     This function allocates memory for a message which can be used
  139.     for Inter-CPU communication. Some fields of the message are
  140.     initialized.
  141.     After this function was called, the message body must be
  142.     created before sending this message.
  143.  
  144.     INPUTS
  145.     bodysize - the size of the message body (max. 65535-MN_SIZE)
  146.     replyport - the reply port
  147.  
  148.     RESULT
  149.     message - The address of an initialized message (except for
  150.           the message body, which must be initialized by the
  151.           programmer).
  152.  
  153.     NOTES
  154.     Calling this function is the only way allowed to create a
  155.     message which can be sent to a PPC task.
  156.  
  157.     A message allocated with 'AllocXMsg' should be freed using
  158.     'FreeXMsg' if it is not used anymore. Since V14, it is
  159.     allowed to free the messsage using 'FreeXMsgPPC' on the
  160.     PPC side (which is internally done using a cross call).
  161.  
  162.     An Inter-CPU message must be sent with 'PutXMsg' to a PPC
  163.     task.
  164.  
  165.     It is possible not to specify a replyport (simply set
  166.     replyport to NULL).
  167.  
  168.     If you want to be compatible to earlier versions, you
  169.     shouldn't free InterCPU messages by the foreign task.
  170.  
  171.     SEE ALSO
  172.     FreeXMsg, PutXMsg
  173.  
  174. powerpc.library/FreeVec32                            powerpc.library/FreeVec32
  175.  
  176.     NAME
  177.     FreeVec32 - frees memory allocated with 'AllocVec32' (V7)
  178.  
  179.     CPU
  180.     680x0
  181.  
  182.     SYNOPSIS
  183.     FreeVec32(memblock)
  184.           a1
  185.  
  186.     void FreeVec32(void *);
  187.  
  188.     FUNCTION
  189.     This function frees a memory block which was allocated using
  190.     'AllocVec32'.
  191.  
  192.     INPUTS
  193.     memblock - The address of the allocated memory block
  194.  
  195.     SEE ALSO
  196.     AllocVec32
  197.  
  198. powerpc.library/FreeXMsg                              powerpc.library/FreeXMsg
  199.  
  200.     NAME
  201.     FreeXMsg - frees a message allocated with 'AllocXMsg' (V12)
  202.  
  203.     CPU
  204.     680x0
  205.  
  206.     SYNOPSIS
  207.     FreeXMsg(message)
  208.          a1
  209.  
  210.     void FreeXMsg(struct Message *);
  211.  
  212.     FUNCTION
  213.     This function frees a memory allocated using 'AllocXMsg'.
  214.  
  215.     INPUTS
  216.     message - a message allocated by 'AllocXMsg'.
  217.  
  218.     NOTES
  219.     There were some restrictions in earlier versions using
  220.     FreeXMsg. Since V14, a XMessage created by AllocXMsg can be
  221.     freed either by another 68K task (if the message isn't used
  222.     anymore) or by a PPC task using FreeXMsgPPC.
  223.  
  224.     SEE ALSO
  225.     AllocXMsg, PutXMsg
  226.  
  227. powerpc.library/GetCPU                                  powerpc.library/GetCPU
  228.  
  229.     NAME
  230.     GetCPU - gets the PowerPC CPU type (V7)
  231.  
  232.     CPU
  233.     680x0
  234.  
  235.     SYNOPSIS
  236.     CPUType = GetCPU
  237.     d0
  238.  
  239.     ULONG GetCPU (void);
  240.  
  241.     FUNCTION
  242.     This function reads the PowerPC CPU type. A longword is returned with
  243.     one specific bit set (see the include file 'powerpc/powerpc.i' for a
  244.     description of the different CPU types)
  245.  
  246.     RESULT
  247.     CPUType - A longword with one specific bit set.
  248.  
  249. powerpc.library/GetPPCState                        powerpc.library/GetPPCState
  250.  
  251.     NAME
  252.     GetPPCState - returns the state of the PPC and PPC applications (V13)
  253.  
  254.     CPU
  255.     680x0
  256.  
  257.     SYNOPSIS
  258.     PPCState = GetPPCState
  259.     d0
  260.  
  261.     ULONG GetPPCState (void);
  262.  
  263.     FUNCTION
  264.     This function returns the current state of the PPC processor and
  265.     the state of custom applications. A bitmask is returned with the
  266.     values defined in 'powerpc.i'.
  267.  
  268.     RESULT
  269.     PPCState - A bitmask. The following bits are supported (the
  270.            description is valid if the bit is 1):
  271.  
  272.            PPCSTATEF_POWERSAVE  - PPC is currently in power save mode.
  273.            PPCSTATEF_APPACTIVE  - PPC application tasks are currently
  274.                     - active resp. installed in the system.
  275.            PPCSTATEF_APPRUNNING - At least one PPC application task is
  276.                       ready or running.
  277.  
  278. powerpc.library/PowerDebugMode                  powerpc.library/PowerDebugMode
  279.  
  280.     NAME
  281.     PowerDebugMode - sets the level of debugging output (V7)
  282.  
  283.     CPU
  284.     680x0
  285.  
  286.     SYNOPSIS
  287.     PowerDebugMode (debuglevel)
  288.             d0
  289.  
  290.     void PowerDebugMode (ULONG);
  291.  
  292.     FUNCTION
  293.     The powerpc.library has a built-in debugging system which prints out
  294.     many informations to the serial port. The main purpose of this
  295.     function is to improve the maintenance of this library. If problems
  296.     occur with the powerpc.library then it will help the author of this
  297.     library a lot to fix the problems. Try to reproduce the problems with
  298.     debugging output enabled and send the debugging output to the author.
  299.     Use a program which captures the data transferred to the serial port
  300.     (for example Sushi) to save the debugging output.
  301.  
  302.     INPUTS
  303.     debuglevel - Debugging level (0-3). All other values are ignored.
  304.              The higher the debugging level, the larger the debugging
  305.              output. 0 means no debugging output.
  306.  
  307.     NOTES
  308.     The powerpc.library operates with debugging level 0 by default (no
  309.     debugging output). You can change the default value with the
  310.     environment variable 'powerpc/debug' (set values from 0 to 3).
  311.  
  312. powerpc.library/PutXMsg                                powerpc.library/PutXMsg
  313.  
  314.     NAME
  315.     PutXMsg - sends an Inter-CPU message to a PPC task (V12)
  316.  
  317.     CPU
  318.     680x0
  319.  
  320.     SYNOPSIS
  321.     PutXMsg(MsgPortPPC, message)
  322.         a0          a1
  323.  
  324.     void PutXMsg(struct MsgPortPPC *, struct Message *);
  325.  
  326.     FUNCTION
  327.     This function sends an Inter-CPU message allocated by 'AllocXMsg'
  328.     to a PPC task.
  329.  
  330.     INPUTS
  331.     MsgPortPPC - a PPC message port
  332.     message - a message allocated by 'AllocXMsg'.
  333.  
  334.     NOTES
  335.     Inter-CPU must NOT be used for internal communication. They can
  336.     only be used for communication between tasks on different processors.
  337.  
  338.     Inter-CPU messages get a different node type, if they are
  339.     sent. If you want to filter out Reply-Messages from standard
  340.     or Inter-CPU messages, compare the LN_TYPE field to NT_REPLYMSG.
  341.     Replied Inter-CPU messages still get the same node type
  342.     (NT_REPLYMSG). Any assumptions about the value of the new
  343.     node type are ILLEGAL!!
  344.  
  345.     As soon as an Inter-CPU message is sent, the 68K looses ownership
  346.     over the message. No access to the message is allowed until the
  347.     reply has been arrived. If no replyport was specified, it's
  348.     allowed to free the message, after it was read from the other side.
  349.  
  350.     Inter-CPU messages can be reused if they have been replied.
  351.  
  352.     Inter-CPU messages are read and replied using the standard
  353.     message handling mechanisms (exec/WaitPort,exec/GetMsg,exec/ReplyMsg
  354.     for 68K, powerpc/WaitPortPPC, powerpc/GetMsgPPC, powerpc/ReplyMsgPPC
  355.     for PPC).
  356.  
  357.     Don't call exec/ReplyMsg with an InterCPU-Message without
  358.     Replyport (versions less than V12.2 crashed).
  359.  
  360.     The receiving task must NOT access message data, which are not
  361.     explicitely located in the message body (for example data which is
  362.     referenced by a pointer) unless both tasks care for the cache
  363.     consistency. Only the message itself is flushed/invalidated
  364.     automatically by the system.
  365.  
  366.     The receiving task may write to the message body of an Inter-CPU
  367.     message.
  368.  
  369.     SEE ALSO
  370.     AllocXMsg, FreeXMsg
  371.  
  372. powerpc.library/RunPPC                                  powerpc.library/RunPPC
  373.  
  374.     NAME
  375.     RunPPC - runs a PowerPC function (V7)
  376.  
  377.     CPU
  378.     680x0
  379.  
  380.     SYNOPSIS
  381.     status = RunPPC(PPStruct)
  382.     d0              a0
  383.  
  384.     LONG RunPPC (struct PowerPC *);
  385.  
  386.     FUNCTION
  387.     Runs a PowerPC function. A mirror PPC process is created. All
  388.     registers can be transferred to PPC as well as parameters on
  389.     stack. All cache management actions are handled automatically.
  390.  
  391.     All registers are transferred back from PPC after the PPC call
  392.     is completed. They are stored in the PowerPC structure.
  393.  
  394.     The register assignment is as follows:
  395.  
  396.     d0      <->     r3              fp0     <->     f1
  397.     d1      <->     r4              fp1     <->     f2
  398.     d2      <->     r22             fp2     <->     f3
  399.     d3      <->     r23             fp3     <->     f4
  400.     d4      <->     r24             fp4     <->     f5
  401.     d5      <->     r25             fp5     <->     f6
  402.     d6      <->     r26             fp6     <->     f7
  403.     d7      <->     r27             fp7     <->     f8
  404.     a0      <->     r5
  405.     a1      <->     r6
  406.     a2      <->     r28
  407.     a3      <->     r29
  408.     a4      <->     r2
  409.     a5      <->     r30
  410.     a6      <->     r31
  411.  
  412.     Please note, that these registers are NOT transferred directly but
  413.     in the register array mentioned above (PP_REGS).
  414.  
  415.     Here follows another table from the PPC's point of view:
  416.  
  417.     PPC-Register:                   Index into the register array:
  418.     ---------------------------------------------------------------
  419.     Base register:
  420.     r2                              12
  421.  
  422.     Scratch registers:
  423.     r3                              0
  424.     r4                              1
  425.     r5                              8
  426.     r6                              9
  427.  
  428.     Nonvolatile registers:
  429.     r22                             2
  430.     r23                             3
  431.     r24                             4
  432.     r25                             5
  433.     r26                             6
  434.     r27                             7
  435.     r28                             10
  436.     r29                             11
  437.     r30                             13
  438.     r31                             14
  439.  
  440. INPUTS
  441.     PPStruct - Pointer to an initialized PowerPC Structure
  442.  
  443.       PP_CODE       : Pointer to the PowerPC code
  444.       PP_OFFSET     : Not used until V12.2 of powerpc.library. From
  445.               V12.3 on, the PP_OFFSET field is used just like
  446.               at Run68K. If PP_OFFSET is zero, than the code
  447.               pointed to by PP_CODE is executed, if PP_OFFSET
  448.               is not zero, a PPC library function is executed
  449.               with PP_CODE containing the library base and
  450.               PP_OFFSET containing the library vector offset.
  451.       PP_FLAGS      : Flags which can be ore'd together
  452.       - PP[F/B]_ASYNC   : Call PPC function asynchronely (68K process
  453.                   returns immediately)
  454.       PP_STACKPTR   : Pointer to the arguments on the stack to be
  455.               transferred. The pointer must point directly
  456.               to the first argument, not to the return address!
  457.               If no arguments on stack should be transferred,
  458.               set this to zero.
  459.       PP_STACKSIZE  : Size of the stack area to be transferred. If no
  460.               stack parameters should be transferred, set this
  461.               to zero.
  462.       PP_REGS       : Array of longwords where the registers to be
  463.               transferred can be stored (d0-a6). Please see
  464.               above for the exact placement of these registers.
  465.       PP_FREGS      : Array of quadwords (8 bytes) where the FP-registers
  466.               to be transferred can be stored (fp0-fp7). fp0 is
  467.               at offset 0, fp1 at offset 8 etc.
  468.  
  469.     RESULT
  470.     status - PPERR_SUCCESS if the call was successfully
  471.          PPERR_ASYNCERR if a synchrone PPC call was made after an
  472.                 asynchrone PPC call
  473.  
  474.     NOTES
  475.     Calling a PPC function asynchronely is dangerous. Take care of
  476.     possible cache conflicts. Avoid calling system functions as much
  477.     as possible.
  478.  
  479.     If an asynchrone PPC call is done, the function WaitForPPC MUST be
  480.     called ONCE after the call was done. No other PPC call is allowed
  481.     for this 68K process after an asynchrone PPC call and before a call
  482.     to WaitForPPC.
  483.  
  484.     If an asynchronely called PPC function performs a 68K call, the call
  485.     is only performed when WaitForPPC is called by the 68K process. Note
  486.     that the PPC mirror process is still connected to the calling 68K
  487.     process.
  488.  
  489.     DON'T pass arguments on stack when calling a PPC function asynchronely.
  490.     The stack is most likely to be trashed before it is copied to the PPC
  491.     stack.
  492.  
  493.     Assembler programmers should use the macros RUNPOWERPC and
  494.     RUNPOWERPC_XL located in the include file 'powerpc/powerpc.i'
  495.  
  496.     SEE ALSO
  497.     WaitForPPC,powerpc/powerpc.i
  498.  
  499. powerpc.library/SPrintF68K                          powerpc.library/SPrintF68K
  500.  
  501.     NAME
  502.     SPrintF68K - prints a formatted string to the serial port (V7)
  503.  
  504.     CPU
  505.     680x0
  506.  
  507.     SYNOPSIS
  508.     SPrintF68K (Formatstring, values )
  509.             a0            a1
  510.  
  511.     void SPrintF68K (STRPTR, APTR);
  512.  
  513.     FUNCTION
  514.     Prints a formatted string to the serial port using the AMIGA-OS
  515.     functions 'exec/RawPutChar' and 'exec/RawDoFmt'. Can be used to add
  516.     debugging features and to improve the maintenance of software.
  517.  
  518.     INPUTS
  519.     Formatstring - A C style string with % commands to indicate where
  520.                parameters have to be inserted (see 'exec/RawDoFmt'
  521.                for a detailed description of these commands).
  522.     values - A pointer to an array of parameters to be inserted into
  523.          specified places in the string.
  524.  
  525.     SEE ALSO
  526.     exec/RawDoFmt
  527.  
  528. powerpc.library/WaitForPPC                          powerpc.library/WaitForPPC
  529.  
  530.     NAME
  531.     WaitForPPC - waits for the completion of an asynchrone PPC call (V7)
  532.  
  533.     CPU
  534.     680x0
  535.  
  536.     SYNOPSIS
  537.     status = WaitForPPC(PPStruct)
  538.     d0                  a0
  539.  
  540.     LONG WaitForPPC (struct PowerPC *);
  541.  
  542.     FUNCTION
  543.     After an asynchrone PPC call was done (see RunPPC) this function must
  544.     be called to wait for the completion of the PowerPC function. All
  545.     registers transferred to the PowerPC with RunPPC are returned into the
  546.     PowerPC Structure.
  547.  
  548.     INPUTS
  549.     PPStruct - Pointer to a PowerPC Structure (see RunPPC for a description
  550.            of the elements). The structure has not to be initialized.
  551.            The structure must be transferred to hold the returned
  552.            registers by the PPC function.
  553.  
  554.     RESULT
  555.     status - PPERR_SUCCESS if the call was successfully
  556.          PPERR_WAITERR if WaitForPPC is called after a synchrone PPC
  557.                    call.
  558.  
  559.     NOTES
  560.     Assembler programmers should use the macros WAITFORPPC and
  561.     WAITFORPPC_XL located in the include file 'powerpc/powerpc.i'
  562.  
  563.     SEE ALSO
  564.     RunPPC,powerpc/powerpc.i
  565.  
  566. powerpc.library/AddHeadPPC                          powerpc.library/AddHeadPPC
  567.  
  568.     NAME
  569.     AddHeadPPC - insert a node at the head of a list (V8)
  570.  
  571.     CPU
  572.     PowerPC
  573.  
  574.     SYNOPSIS
  575.     AddHeadPPC(_PowerPCBase, list, node)
  576.            r3            r4    r5
  577.  
  578.     void AddHeadPPC(struct Library *, struct List*, struct Node*);
  579.  
  580.     FUNCTION
  581.     Insert a node to the head of a standard exec list. This is the
  582.     mirror function of exec/AddHead.
  583.  
  584.     INPUTS
  585.     _PowerPCBase - base of powerpc.library (can be omitted)
  586.     list - a pointer to the target list
  587.     node - the node to insert
  588.  
  589.     NOTES
  590.     This function is guaranteed to work correctly, if the PowerPCBase
  591.     is not passed in r3.
  592.  
  593.     Assembler programmers may use the macro _ADDHEAD located in
  594.     'powerpc/listsPPC.i'
  595.  
  596.     This function is safe to call from exception handlers.
  597.  
  598.     SEE ALSO
  599.     InsertPPC, AddTailPPC, RemovePPC, RemHeadPPC, RemTailPPC,
  600.     EnqueuePPC, FindNamePPC, powerpc/listsPPC.i
  601.  
  602. powerpc.library/AddPortPPC                          powerpc.library/AddPortPPC
  603.  
  604.     NAME
  605.     AddPortPPC - adds a public PPC message port to the system (V11)
  606.  
  607.     CPU
  608.     PowerPC
  609.  
  610.     SYNOPSIS
  611.     AddPortPPC(_PowerPCBase, MsgPortPPC)
  612.            r3            r4
  613.  
  614.     void AddPortPPC(struct Library *, struct MsgPortPPC *);
  615.  
  616.     FUNCTION
  617.     This function adds a PPC message port to a public list of ports.
  618.     The message port should be named and the priority field should
  619.     be set. A public message port can be found by name using
  620.     'FindPortPPC'. This is the mirror function of exec/AddPort.
  621.  
  622.     INPUTS
  623.     _PowerPCBase - base of powerpc.library
  624.     MsgPortPPC - pointer to a PPC message port. It's safe to pass a
  625.              NULL parameter.
  626.  
  627.     SEE ALSO
  628.     CreateMsgPortPPC,DeleteMsgPortPPC,FindPortPPC,RemPortPPC
  629.     powerpc/portsPPC.i
  630.  
  631. powerpc.library/AddSemaphorePPC                powerpc.library/AddSemaphorePPC
  632.  
  633.     NAME
  634.     AddSemaphorePPC - initializes a global signal semaphore (V8)
  635.  
  636.     CPU
  637.     PowerPC
  638.  
  639.     SYNOPSIS
  640.     status = AddSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  641.     r3                        r3            r4
  642.  
  643.     LONG AddSemaphorePPC(struct Library *, struct SignalSemaphorePPC *);
  644.  
  645.     FUNCTION
  646.     Initializes a signal semaphore and adds it to the public semaphore
  647.     list. This is the mirror function of exec/AddSemaphore.
  648.  
  649.     INPUTS
  650.     _PowerPCBase - base of powerpc.library
  651.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  652.                  (a semaphore name should be specified)
  653.  
  654.     RESULT
  655.     status - status value:
  656.         SSPPC_SUCCESS: function was successful
  657.         SSPPC_NOMEM: function failed due to lack of memory
  658.  
  659.     SEE ALSO
  660.     InitSemaphorePPC, FreeSemaphorePPC, ObtainSemaphorePPC,
  661.     AttemptSemaphorePPC, ReleaseSemaphorePPC, RemSemaphorePPC,
  662.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  663.  
  664. powerpc.library/AddTailPPC                          powerpc.library/AddTailPPC
  665.  
  666.     NAME
  667.     AddTailPPC - insert a node at the tail of a list (V8)
  668.  
  669.     CPU
  670.     PowerPC
  671.  
  672.     SYNOPSIS
  673.     AddTailPPC(_PowerPCBase, list, node)
  674.            r3            r4    r5
  675.  
  676.     void AddTailPPC(struct Library *, struct List*, struct Node*);
  677.  
  678.     FUNCTION
  679.     Insert a node to the tail of a standard exec list. This is the
  680.     mirror function of exec/AddTail.
  681.  
  682.     INPUTS
  683.     _PowerPCBase - base of powerpc.library (can be omitted)
  684.     list - a pointer to the target list
  685.     node - the node to insert
  686.  
  687.     NOTES
  688.     This function is guaranteed to work correctly, if the PowerPCBase
  689.     is not passed in r3.
  690.  
  691.     Assembler programmers may use the macro _ADDTAIL located in
  692.     'powerpc/listsPPC.i'
  693.  
  694.     This function is safe to call from exception handlers.
  695.  
  696.     SEE ALSO
  697.     InsertPPC, AddHeadPPC, RemovePPC, RemHeadPPC, RemTailPPC,
  698.     EnqueuePPC, FindNamePPC, powerpc/listsPPC.i
  699.  
  700. powerpc.library/AddTimePPC                          powerpc.library/AddTimePPC
  701.  
  702.     NAME
  703.     AddTimePPC - adds one time request to another (V7)
  704.  
  705.     CPU
  706.     PowerPC
  707.  
  708.     SYNOPSIS
  709.     AddTimePPC(_PowerPCBase, Dest, Source)
  710.            r3            r4    r5
  711.  
  712.     void AddTimePPC(struct Library *, struct timeval *, struct timeval *);
  713.  
  714.     FUNCTION
  715.     This routine adds one timeval structure to another. The results are
  716.     stored in the destination (Dest + Source -> Dest)
  717.  
  718.     This is the mirror function of timer/AddTime.
  719.  
  720.     INPUTS
  721.     _PowerPCBase - base of powerpc.library
  722.     Dest - pointer to a timeval structure
  723.     Source - pointer to a timeval structure
  724.  
  725.     NOTES
  726.     This function is safe to call from exception handlers
  727.  
  728.     SEE ALSO
  729.     GetSysTimePPC, SubTimePPC, CmpTimePPC
  730.  
  731. powerpc.library/AllocSignalPPC                  powerpc.library/AllocSignalPPC
  732.  
  733.     NAME
  734.     AllocSignalPPC - allocate a signal (V8)
  735.  
  736.     CPU
  737.     PowerPC
  738.  
  739.     SYNOPSIS
  740.     signalnum = AllocSignalPPC(_PowerPCBase, signalNum)
  741.     r3                         r3            r4
  742.  
  743.     LONG AllocSignalPPC(struct Library *, LONG);
  744.  
  745.     FUNCTION
  746.     Allocate a signal bit from the current task's pool. Either a
  747.     particular bit or the next free bit may be allocated. This
  748.     is the mirror function of exec/AllocSignal.
  749.  
  750.     INPUTS
  751.     _PowerPCBase - base of powerpc.library
  752.     signalNum - the desired signal bit number (0..31) or -1
  753.             if the next free bit should be allocated
  754.  
  755.     RESULT
  756.     signalnum - the signal bit allocated or -1 for failure.
  757.  
  758.     NOTES
  759.     IMPORTANT: The signal bit numbers are returned in the
  760.     68K notation! For example, if the number 27 is returned,
  761.     the waiting mask must be $08000000.
  762.  
  763.     All signal allocations are kept coherent on both CPU's.
  764.     A signal allocated on the 68K side is not free anymore
  765.     for the mirror PPC task and vice versa. The PPC also
  766.     can wait for signals or send signals allocated on the
  767.     68K side and vice versa (V11).
  768.  
  769.     SEE ALSO
  770.     FreeSignalPPC, SetSignalPPC, SignalPPC, WaitPPC
  771.  
  772. powerpc.library/AllocVecPPC                        powerpc.library/AllocVecPPC
  773.  
  774.     NAME
  775.     AllocVecPPC - allocates memory for PPC with MMU support (V7)
  776.  
  777.     CPU
  778.     PowerPC
  779.  
  780.     SYNOPSIS
  781.     memblock = AllocVecPPC(_PowerPCBase, memsize, attributes, alignment)
  782.     r3                     r3            r4       r5          r6
  783.  
  784.     void *AllocVecPPC(struct Library *, ULONG, ULONG, ULONG);
  785.  
  786.     FUNCTION
  787.     This function allocates memory which is correctly aligned for the use
  788.     by PowerPC applications. It's the mirror function of exec/AllocVec
  789.     but offers some additional features.
  790.     AllocVecPPC supports user defined alignment and allocation of memory-
  791.     blocks with a desired cache mode (MMU support only for V9+)
  792.     Since V12, it's possible to allocate memory, which is protected
  793.     against other tasks (either full- or write-protected).
  794.  
  795.     INPUTS
  796.     _PowerPCBase - base of powerpc.library
  797.     memsize - the amount of memory to be allocated.
  798.     attributes - the requirements as explained in exec/AllocMem
  799.              This function offers some additional attributes:
  800.  
  801.         MEMF_WRITETHROUGH: maps the allocated memory as writethrough
  802.         MEMF_COPYBACK:     maps the allocated memory as copyback
  803.         MEMF_CACHEON:      maps the allocated memory as cachable
  804.         MEMF_CACHEOFF:     maps the allocated memory as noncachable
  805.         MEMF_GUARDED:      maps the allocated memory as guarded
  806.         MEMF_NOTGUARDED:   maps the allocated memory as not guarded
  807.         MEMF_BAT:          puts the allocated memory block into a
  808.                    BAT register
  809.         MEMF_PROTECT:      the memory block should be full-protected
  810.                    against other tasks (no user-accesses of
  811.                    other tasks allowed).
  812.         MEMF_WRITEPROTECT: the memory block should be write-protected
  813.                    against other tasks (no user-write-acesses
  814.                    of other tasks allowed).
  815.  
  816.     alignment - the desired alignment of the memory block. The system
  817.             may round this value up to a minimal alignment. It's
  818.             safe to pass 0 as alignment.
  819.  
  820.     RESULT
  821.     memblock - The address of the allocated memory. If the
  822.            memory couldn't be allocated 0 is returned.
  823.  
  824.     NOTES
  825.     The amount of memory effectively allocated is usually bigger
  826.     than the given memsize. It's not a good idea to call this
  827.     function many times to allocate very small pieces of memory.
  828.  
  829.     If some of the additional memflags are specified, the alignment
  830.     and the size is internally rounded up to meet the requirements
  831.     of the MMU.
  832.  
  833.     The additional MMU memflags are intended for highly optimizing
  834.     code and shoud not be used by standard applications.
  835.  
  836.     The memflag MEMF_BAT can improve the performance of the memory
  837.     accesses heavily (especially on CPU's with software tablesearch).
  838.     But DON'T use this flag unless you really need the speed. Note:
  839.     The required free memory has to be much bigger than the size of
  840.     the memory to be allocated, because there are severe alignment
  841.     restrictions when using BAT registers.
  842.  
  843.     The memflag MEMF_BAT has no effect if the task runs with BAT MMU
  844.     Setup.
  845.  
  846.     Note that no other tasks should access memory which was allocated
  847.     using special MMU memflags, because the other task can probably
  848.     run under a different MMU setup which can cause cache problems,
  849.     if the other one writes to the same memory in copyback mode
  850.     while this task accesses the data in noncachable mode, for
  851.     example.
  852.  
  853.     The MMU support ist not implemented in powerpc.library <= V9.
  854.     The memory protection support ist not implemented in
  855.     powerpc.library <= V11.
  856.  
  857.     BUGS
  858.     Before V14, allocations > 512KB could fail.
  859.  
  860.     SEE ALSO
  861.     FreeVecPPC, FreeAllMem, powerpc/memoryPPC.i
  862.  
  863. powerpc.library/AllocXMsgPPC                      powerpc.library/AllocXMsgPPC
  864.  
  865.     NAME
  866.     AllocXMsgPPC - allocates a message for Inter-CPU communication (V12)
  867.  
  868.     CPU
  869.     PowerPC
  870.  
  871.     SYNOPSIS
  872.     message = AllocXMsgPPC(_PowerPCBase, bodysize, replyport)
  873.     r3                     r3            r4        r5
  874.  
  875.     struct Message *AllocXMsgPPC(struct Library *, ULONG, struct MsgPort *);
  876.  
  877.     FUNCTION
  878.     This function allocates memory for a message which can be used
  879.     for Inter-CPU communication. Some fields of the message are
  880.     initialized.
  881.     After this function was called, the message body must be
  882.     created before sending this message.
  883.  
  884.     INPUTS
  885.     _PowerPCBase - base of powerpc.library
  886.     bodysize - the size of the message body (max. 65535-MN_SIZE)
  887.     replyport - the reply port
  888.  
  889.     RESULT
  890.     message - The address of an initialized message (except for
  891.           the message body, which must be initialized by the
  892.           programmer).
  893.  
  894.     NOTES
  895.     Calling this function is the only way allowed to create a
  896.     message which can be sent to a 68K task.
  897.  
  898.     A message allocated with 'AllocXMsgPPC' should be freed using
  899.     'FreeXMsgPPC' if it is not used anymore. Since V14, it is
  900.     allowed to free the messsage using 'FreeXMsg' on the
  901.     68K side (which is internally done using a cross call).
  902.  
  903.     An Inter-CPU message must be sent with 'PutXMsgPPC' to a 68K
  904.     task.
  905.  
  906.     It is possible not to specify a replyport (simply set
  907.     replyport to NULL).
  908.  
  909.     If you want to be compatible to earlier versions, you
  910.     shouldn't free InterCPU messages by the foreign task.
  911.  
  912.     SEE ALSO
  913.     FreeXMsgPPC, PutXMsgPPC
  914.  
  915. powerpc.library/AttemptSemaphorePPC        powerpc.library/AttemptSemaphorePPC
  916.  
  917.     NAME
  918.     AttemptSemaphorePPC - try to obtain without blocking (V8)
  919.  
  920.     CPU
  921.     PowerPC
  922.  
  923.     SYNOPSIS
  924.     status = AttemptSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  925.                      r3            r4
  926.  
  927.     LONG AttemptSemaphorePPC(struct Library *,
  928.                   struct SignalSemaphorePPC *);
  929.  
  930.     FUNCTION
  931.     Tries to get exclusive access to a signal semaphore. If the semaphore
  932.     is locked by another task, this function returns with an appropriate
  933.     status value. This is the mirror function of exec/AttemptSemaphore
  934.  
  935.     INPUTS
  936.     _PowerPCBase - base of powerpc.library
  937.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  938.  
  939.     RESULT
  940.     status - status value:
  941.         ATTEMPT_SUCCESS: operation successful
  942.         ATTEMPT_FAILURE: semaphore couldn't be locked
  943.  
  944.     NOTES
  945.     This call is guaranteed to preserve all GPR (except r0 and r3)
  946.     and the CTR.
  947.  
  948.     SEE ALSO
  949.     InitSemaphorePPC, FreeSemaphorePPC, ObtainSemaphorePPC,
  950.     ReleaseSemaphorePPC, AddSemaphorePPC, RemSemaphorePPC
  951.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  952.  
  953. powerpc.library/ChangeMMU                            powerpc.library/ChangeMMU
  954.  
  955.     NAME
  956.     ChangeMMU - changes the MMU setup of the current task (V10)
  957.  
  958.     CPU
  959.     PowerPC
  960.  
  961.     SYNOPSIS
  962.     ChangeMMU(_PowerPCBase, MMUMode)
  963.           r3            r4
  964.  
  965.     void ChangeMMU(struct Library *, ULONG);
  966.  
  967.     FUNCTION
  968.     Changes the MMU setup of the currently running task. A task is able
  969.     to run with two different MMU setups:
  970.  
  971.     - paged MMU setup: The standard method, where almost every memory
  972.       access is controlled by the page table
  973.     - BAT MMU setup: Almost all the memory is controlled by the 4 BAT
  974.       registers.
  975.  
  976.     INPUTS
  977.     _PowerPCBase - base of powerpc.library
  978.     MMUMode - CHMMU_STANDARD: change MMU setup to standard
  979.           CHMMU_BAT     : change MMU setup to BAT setup
  980.  
  981.     NOTES
  982.     This function should usually NOT be called. It is intended for
  983.     highly optimizing code and should only be used, if enough MMU
  984.     knowledge is present.
  985.  
  986.     The state of the current task can be changed from the shell by
  987.     using the tool 'changemmu' (and this is the better way how to
  988.     change the setup rather than calling the library function)
  989.  
  990.     SEE ALSO
  991.     powerpc/tasksppc.i
  992.  
  993. powerpc.library/ClearExcMMU                        powerpc.library/ClearExcMMU
  994.  
  995.     NAME
  996.     ClearExcMMU - removes the temp. MMU setup installed by SetExcMMU (V10)
  997.  
  998.     CPU
  999.     PowerPC
  1000.  
  1001.     SYNOPSIS
  1002.     ClearExcMMU(_PowerPCBase)
  1003.             r3
  1004.  
  1005.     void ClearExcMMU(struct Library *);
  1006.  
  1007.     FUNCTION
  1008.     This function is for exception handlers only. It removes the temporary
  1009.     BAT based MMU setup, which was installed using SetExcMMU. The old MMU
  1010.     state is restored.
  1011.  
  1012.     INPUTS
  1013.     _PowerPCBase - base of powerpc.library
  1014.  
  1015.     NOTES
  1016.     This function must not be called from anywhere else than from
  1017.     an exception handler.
  1018.  
  1019.     SEE ALSO
  1020.     SetExcMMU
  1021.  
  1022. powerpc.library/CmpTimePPC                          powerpc.library/CmpTimePPC
  1023.  
  1024.     NAME
  1025.     CmpTimePPC - compares two timeval structures (V7)
  1026.  
  1027.     CPU
  1028.     PowerPC
  1029.  
  1030.     SYNOPSIS
  1031.     result = CmpTimePPC(_PowerPCBase, Dest, Source)
  1032.     r3                  r3            r4    r5
  1033.  
  1034.     LONG CmpTimePPC(struct Library *, struct timeval *, struct timeval *);
  1035.  
  1036.     FUNCTION
  1037.     This routine compares two timeval structures.
  1038.  
  1039.     This is the mirror function of timer/CmpTime.
  1040.  
  1041.     INPUTS
  1042.     _PowerPCBase - base of powerpc.library
  1043.     Dest - pointer to a timeval structure
  1044.     Source - pointer to a timeval structure
  1045.  
  1046.     RESULT
  1047.     0  - if both timeval structures are equal
  1048.     -1 - if Dest is greater than Source
  1049.     1  - if Dest is less than Source
  1050.  
  1051.  
  1052.     NOTES
  1053.     This function is safe to call from exception handlers
  1054.  
  1055.     SEE ALSO
  1056.     GetSysTimePPC, AddTimePPC, SubTimePPC
  1057.  
  1058. powerpc.library/CopyMemPPC                          powerpc.library/CopyMemPPC
  1059.  
  1060.     NAME
  1061.     CopyMemPPC - copies memory the fastest way possible (V12)
  1062.  
  1063.     CPU
  1064.     PowerPC
  1065.  
  1066.     SYNOPSIS
  1067.     CopyMemPPC(_PowerPCBase, source, dest, size)
  1068.            r3            r4      r5    r6
  1069.  
  1070.     void CopyMemPPC(struct Library *, void *, void *, ULONG);
  1071.  
  1072.     FUNCTION
  1073.     This function copies a source memory area to a destination memory
  1074.     area. No overlapping is supported. CopyMemPPC tries to copy with
  1075.     the highest bandwidth possible.
  1076.  
  1077.     INPUTS
  1078.     _PowerPCBase - base of powerpc.library
  1079.     source - address of the source memory area
  1080.     dest - address of the destination memory area
  1081.     size - size of the memory area to be copied
  1082.  
  1083.     NOTES
  1084.     The highest performance can be achieved if both memory areas have
  1085.     a minimal alignment of 8.
  1086.  
  1087. powerpc.library/CreateMsgPortPPC              powerpc.library/CreateMsgPortPPC
  1088.  
  1089.     NAME
  1090.     CreateMsgPortPPC - creates a new PPC message port (V11)
  1091.  
  1092.     CPU
  1093.     PowerPC
  1094.  
  1095.     SYNOPSIS
  1096.     MsgPortPPC = CreateMsgPortPPC(_PowerPCBase)
  1097.     r3                            r3
  1098.  
  1099.     struct MsgPortPPC *CreateMsgPortPPC(struct Library *);
  1100.  
  1101.     FUNCTION
  1102.     This function creates a new PowerPC message port. This is the only
  1103.     way allowed to create a PPC message port. It is the mirror function
  1104.     of exec/CreateMsgPort.
  1105.  
  1106.     INPUTS
  1107.     _PowerPCBase - base of powerpc.library
  1108.  
  1109.     RESULT
  1110.     MsgPortPPC - pointer to a MsgPortPPC structure or NULL for failure
  1111.  
  1112.     NOTES
  1113.     A PowerPC message port should be deleted using 'DeleteMsgPortPPC'
  1114.     if it is not used anymore.
  1115.  
  1116.     It's forbidden to access PPC message ports by the standard
  1117.     exec message handling routines.
  1118.  
  1119.     SEE ALSO
  1120.     DeleteMsgPortPPC,FindPortPPC,AddPortPPC,RemPortPPC
  1121.     powerpc/portsPPC.i
  1122.  
  1123. powerpc.library/CreateTaskPPC                    powerpc.library/CreateTaskPPC
  1124.  
  1125.     NAME
  1126.     CreateTaskPPC - creates a new PPC task (V8)
  1127.  
  1128.     CPU
  1129.     PowerPC
  1130.  
  1131.     SYNOPSIS
  1132.     TaskPPC = CreateTaskPPC(_PowerPCBase, TagItems)
  1133.     r3                      r3            r4
  1134.  
  1135.     struct TaskPPC *CreateTaskPPC(struct Library *, struct TagItem *);
  1136.  
  1137.     FUNCTION
  1138.     This function creates a new PPC task under control of the tags passed.
  1139.     All memory (inclusive stack) is allocated automatically.
  1140.  
  1141.     PPC tasks are similar to exec tasks (the first element of the TaskPPC
  1142.     structure is an exec task structure). The scheduling of these tasks
  1143.     works similar to exec, so a running task blocks all tasks with lower
  1144.     priority.
  1145.  
  1146.     INPUTS
  1147.     _PowerPCBase - base of powerpc.library
  1148.     TagItems - pointer to a tagitem array. The following tags are
  1149.            supported:
  1150.  
  1151.         TASKATTR_CODE:      pointer to the entry point of the new task
  1152.                 (MUST be specified)
  1153.         TASKATTR_EXITCODE:  pointer to the exit routine of the new task
  1154.         TASKATTR_NAME:      task name (MUST be specified)
  1155.         TASKATTR_PRI:       task priority (-128 ... 127). Default = 0.
  1156.         TASKATTR_STACKSIZE: the desired stack size. If this tag is omitted
  1157.                 the default stack size will be 16K.
  1158.         TASKATTR_R2:        smalldata base of the PPC program
  1159.         TASKATTR_R3:
  1160.         ...
  1161.         TASKATTR_R10:       parameters to be passed to the new task
  1162.                 in the specified registers
  1163.         TASKATTR_MOTHERPRI: the priority is taken from the currently
  1164.                 running task (TASKATTR_PRI is ignored) (V9)
  1165.         TASKATTR_BAT:       lets the task run under BAT MMU setup by
  1166.                 default (V10)
  1167.  
  1168.     RESULT
  1169.     TaskPPC - pointer to a TaskPPC structure or NULL for failure
  1170.  
  1171.     NOTES
  1172.     If a 68K application only wants to call a PPC function, it's
  1173.     better to use Run68K instead of creating a new PPC task.
  1174.  
  1175.     While a PPC task created by Run68K is always connected to
  1176.     the calling 68K process, a task created by CreateTaskPPC is
  1177.     completely independent. If such a task peforms 68K calls, a
  1178.     new mirror process on the 68K side is created.
  1179.  
  1180.     If an alternative exit code is specified (TASKATTR_EXITCODE)
  1181.     the value passed in TASKATTR_R2 remains intact in this exit
  1182.     code.
  1183.  
  1184.     SEE ALSO
  1185.     DeleteTaskPPC,FindTaskPPC,powerpc/tasksPPC.i
  1186.  
  1187. powerpc.library/DeleteMsgPortPPC              powerpc.library/DeleteMsgPortPPC
  1188.  
  1189.     NAME
  1190.     DeleteMsgPortPPC - deletes a PPC message port (V11)
  1191.  
  1192.     CPU
  1193.     PowerPC
  1194.  
  1195.     SYNOPSIS
  1196.     DeleteMsgPortPPC(_PowerPCBase, MsgPortPPC)
  1197.              r3            r4
  1198.  
  1199.     void DeleteMsgPortPPC(struct Library *, struct MsgPortPPC *);
  1200.  
  1201.     FUNCTION
  1202.     This function deletes a PowerPC message port created using
  1203.     'CreateMsgPortPPC'. It is the mirror function of exec/DeleteMsgPort.
  1204.  
  1205.     INPUTS
  1206.     _PowerPCBase - base of powerpc.library
  1207.     MsgPortPPC - Pointer to the message port to delete. It's safe to
  1208.              pass NULL as parameter
  1209.  
  1210.     NOTES
  1211.     Calling 'DeleteMsgPortPPC' is the ONLY way allowed to delete a PPC
  1212.     message port.
  1213.  
  1214.     SEE ALSO
  1215.     CreateMsgPortPPC,FindPortPPC,AddPortPPC,RemPortPPC
  1216.     powerpc/portsPPC.i
  1217.  
  1218. powerpc.library/DeleteTaskPPC                    powerpc.library/DeleteTaskPPC
  1219.  
  1220.     NAME
  1221.     DeleteTaskPPC - deletes a PPC task (V8)
  1222.  
  1223.     CPU
  1224.     PowerPC
  1225.  
  1226.     SYNOPSIS
  1227.     DeleteTaskPPC(_PowerPCBase, PPCTask)
  1228.               r3            r4
  1229.  
  1230.     void DeleteTaskPPC(struct Library *, struct TaskPPC *);
  1231.  
  1232.     FUNCTION
  1233.     Deletes a PPC task created by CreateTaskPPC.
  1234.  
  1235.     INPUTS
  1236.     _PowerPCBase - base of powerpc.library
  1237.     TaskPPC - PPC task to remove or NULL for self removal
  1238.  
  1239.     NOTES
  1240.     It's not encouraged to delete other tasks. This function
  1241.     should only be called with a NULL parameter to remove the
  1242.     calling task itself.
  1243.  
  1244.     The system may also remove an existing 68K mirror process
  1245.     connected to the calling PPC task.
  1246.  
  1247.     SEE ALSO
  1248.     CreateTaskPPC,FindTaskPPC,powerpc/tasksPPC.i
  1249.  
  1250. powerpc.library/EndSnoopTask                      powerpc.library/EndSnoopTask
  1251.  
  1252.     NAME
  1253.     EndSnoopTask - stops monitoring a PPC task (V13)
  1254.  
  1255.     CPU
  1256.     PowerPC
  1257.  
  1258.     SYNOPSIS
  1259.     EndSnoopTask (_PowerPCBase, SnoopID)
  1260.               r3            r4
  1261.  
  1262.     void EndSnoopTask (struct Library *, ULONG);
  1263.  
  1264.     FUNCTION
  1265.     This function removes a callback job, which was installed using
  1266.     powerpc/SnoopTask.
  1267.  
  1268.     INPUTS
  1269.     _PowerPCBase - base of powerpc.library
  1270.     SnoopID - The value returned by SnoopTask. It's safe to pass
  1271.           NULL as parameter (is handled as no-op)
  1272.  
  1273.     SEE ALSO
  1274.     SnoopTask
  1275.  
  1276. powerpc.library/EnqueuePPC                          powerpc.library/EnqueuePPC
  1277.  
  1278.     NAME
  1279.     EnqueuePPC - inserts a node into a list sorted by priority (V8)
  1280.  
  1281.     CPU
  1282.     PowerPC
  1283.  
  1284.     SYNOPSIS
  1285.     EnqueuePPC(_PowerPCBase, list, node)
  1286.            r3            r4    r5
  1287.  
  1288.     void EnqueuePPC(struct Library *, struct List*, struct Node*);
  1289.  
  1290.     FUNCTION
  1291.     Inserts a node to a standard exec list based on the node priority.
  1292.     In this way a list can be kept sorted by priority all the time.
  1293.     New nodes will be inserted in front of the first node with a
  1294.     lower priority. This is the mirror function of exec/Enqueue.
  1295.  
  1296.     INPUTS
  1297.     _PowerPCBase - base of powerpc.library (can be omitted)
  1298.     list - a pointer to the target list
  1299.     node - the node to enqueue
  1300.  
  1301.     NOTES
  1302.     This function is guaranteed to work correctly, if the PowerPCBase
  1303.     is not passed in r3.
  1304.  
  1305.     This function is safe to call from exception handlers.
  1306.  
  1307.     SEE ALSO
  1308.     InsertPPC, AddTailPPC, AddHeadPPC, RemovePPC, RemHeadPPC,
  1309.     RemTailPPC, FindNamePPC, powerpc/listsPPC.i
  1310.  
  1311. powerpc.library/FindNamePPC                        powerpc.library/FindNamePPC
  1312.  
  1313.     NAME
  1314.     FindNamePPC - finds a node with given name (V8)
  1315.  
  1316.     CPU
  1317.     PowerPC
  1318.  
  1319.     SYNOPSIS
  1320.     node = FindNamePPC(_PowerPCBase, start, name)
  1321.     r3                 r3            r4     r5
  1322.  
  1323.     struct Node *FindNamePPC(struct Library *, struct List*, STRPTR);
  1324.  
  1325.     FUNCTION
  1326.     Searches a list for a node with the given name. If multiple nodes
  1327.     with same names should be found, this function can be called with
  1328.     a node starting point.
  1329.  
  1330.     INPUTS
  1331.     _PowerPCBase - base of powerpc.library
  1332.     list - a list header or a node to start the searche (if node,
  1333.            this one is skipped)
  1334.     name - the name of the node
  1335.  
  1336.     NOTES
  1337.     This function is guaranteed to work correctly, if the PowerPCBase
  1338.     is not passed in r3.
  1339.  
  1340.     This function is safe to call from exception handlers.
  1341.  
  1342.     SEE ALSO
  1343.     InsertPPC, AddTailPPC, AddHeadPPC, RemovePPC, RemHeadPPC,
  1344.     RemTailPPC, EnqueuePPC, powerpc/listsPPC.i
  1345.  
  1346. powerpc.library/FindPortPPC                        powerpc.library/FindPortPPC
  1347.  
  1348.     NAME
  1349.     FindPortPPC - finds a public PPC message port by name (V11)
  1350.  
  1351.     CPU
  1352.     PowerPC
  1353.  
  1354.     SYNOPSIS
  1355.     MsgPortPPC = FindPortPPC(_PowerPCBase, name)
  1356.     r3                       r3            r4
  1357.  
  1358.     struct MsgPortPPC* FindPortPPC(struct Library *, STRPTR);
  1359.  
  1360.     FUNCTION
  1361.     This function will search the global list of PPC message ports
  1362.     for a port with the given name. No arbritation is needed. This
  1363.     is the mirror function of exec/FindPort.
  1364.  
  1365.     INPUTS
  1366.     _PowerPCBase - base of powerpc.library
  1367.     name - name of the PPC message port to search
  1368.  
  1369.     RESULT
  1370.     MsgPortPPC - pointer to a PPC message port or NULL if it was not
  1371.              found.
  1372.  
  1373.     SEE ALSO
  1374.     CreateMsgPortPPC,DeleteMsgPortPPC,AddPortPPC,RemPortPPC
  1375.     powerpc/portsPPC.i
  1376.  
  1377. powerpc.library/FindSemaphorePPC              powerpc.library/FindSemaphorePPC
  1378.  
  1379.     NAME
  1380.     FindSemaphorePPC - finds a public semaphore (V8)
  1381.  
  1382.     CPU
  1383.     PowerPC
  1384.  
  1385.     SYNOPSIS
  1386.     SignalsemaphorePPC = FindSemaphorePPC(_PowerPCBase, SemaphoreName)
  1387.     r3                                    r3            r4
  1388.  
  1389.     struct signalsemaphorePPC *FindSemaphorePPC(struct Library *, STRPTR);
  1390.  
  1391.     FUNCTION
  1392.     Finds a public semaphore added to the system semaphore list by
  1393.     AddSemaphore. This is the mirror function to exec/FindSemaphore.
  1394.  
  1395.     INPUTS
  1396.     _PowerPCBase - base of powerpc.library
  1397.     SemaphoreName - name of the semaphore to find
  1398.  
  1399.     RESULT
  1400.     SignalsemaphorePPC - signal semaphore requested or 0 if it was not
  1401.                  found
  1402.  
  1403.     SEE ALSO
  1404.     InitSemaphorePPC, FreeSemaphorePPC, ObtainSemaphorePPC,
  1405.     AttemptSemaphorePPC, ReleaseSemaphorePPC, AddSemaphorePPC,
  1406.     RemSemaphorePPC, powerpc/semaphoresPPC.i
  1407.  
  1408. powerpc.library/FindTagItemPPC                  powerpc.library/FindTagItemPPC
  1409.  
  1410.     NAME
  1411.     FindTagItemPPC - scan a tag list for a specific tag (V8)
  1412.  
  1413.     CPU
  1414.     PowerPC
  1415.  
  1416.     SYNOPSIS
  1417.     tag = FindTagItemPPC(_PowerPCBase, tagValue, tagList)
  1418.     r3                   r3            r4        r5
  1419.  
  1420.     struct TagItem *FindTagItemPPC(struct Library *, ULONG,
  1421.                        struct TagItem *);
  1422.  
  1423.     FUNCTION
  1424.     Scans a tag list and returns a pointer to the first item with
  1425.     ti_Tag matching the 'tagValue' parameter. This is the mirror
  1426.     function of utility/FindTagItem.
  1427.  
  1428.     INPUTS
  1429.     _PowerPCBase - base of powerpc.library
  1430.     tagValue - tag value to search for
  1431.     tagList - tag item list to search (may be NULL)
  1432.  
  1433.     RESULT
  1434.     tag - a pointer to the item with ti_Tag matching 'tagValue'
  1435.           or NULL if no match was found.
  1436.  
  1437.     NOTES
  1438.     This function is safe to call from exception handlers.
  1439.  
  1440.     SEE ALSO
  1441.     GetTagDataPPC, NextTagItemPPC, utility/tagitem.i
  1442.  
  1443. powerpc.library/FindTaskByID                      powerpc.library/FindTaskByID
  1444.  
  1445.     NAME
  1446.     FindTaskByID - evaluates the task address for a given task ID (V14)
  1447.  
  1448.     CPU
  1449.     PowerPC
  1450.  
  1451.     SYNOPSIS
  1452.     TaskPPC = FindTaskByID(_PowerPCBase, taskID)
  1453.     r3                     r3            r4
  1454.  
  1455.     struct TaskPPC *FindTaskByID(struct Library *, ULONG);
  1456.  
  1457.     FUNCTION
  1458.     Evaluates the task address for a given task ID.
  1459.  
  1460.     INPUTS
  1461.     _PowerPCBase - base of powerpc.library
  1462.     taskID - the task's ID number
  1463.  
  1464.     RESULT
  1465.     TaskPPC - Pointer to the PPCTask structure
  1466.  
  1467.     SEE ALSO
  1468.     CreateTaskPPC,DeleteTaskPPC,powerpc/tasksPPC.i
  1469.  
  1470. powerpc.library/FindTaskPPC                    powerpc.library/FindTaskPPC
  1471.  
  1472.     NAME
  1473.     FindTaskPPC - finds a task by name (or find oneself) (V8)
  1474.  
  1475.     CPU
  1476.     PowerPC
  1477.  
  1478.     SYNOPSIS
  1479.     TaskPPC = FindTaskPPC(_PowerPCBase, Name)
  1480.     r3                    r3            r4
  1481.  
  1482.     struct TaskPPC *FindTaskPPC(struct Library *, STRPTR);
  1483.  
  1484.     FUNCTION
  1485.     Tries to find a task with the given name (or the current task if
  1486.     NULL is specified). This is the mirror function of exec/FindTask.
  1487.  
  1488.     INPUTS
  1489.     _PowerPCBase - base of powerpc.library
  1490.     Name - name of the task to find or NULL for the current task
  1491.  
  1492.     RESULT
  1493.     TaskPPC - pointer to the TaskPPC structure or NULL if the task
  1494.           was not found
  1495.  
  1496.     NOTES
  1497.     Be cautious that a task may be removed at any time, so the
  1498.     pointer returned may not be valid anymore when used.
  1499.  
  1500.     It's allowed to call FindTaskPPC with a NULL parameter from
  1501.     an exception handler. In this case the interrupted task is
  1502.     returned.
  1503.  
  1504.     SEE ALSO
  1505.     CreateTaskPPC, DeleteTaskPPC, FindTaskByID, powerpc/tasksPPC.i
  1506.  
  1507. powerpc.library/FreeAllMem                          powerpc.library/FreeAllMem
  1508.  
  1509.     NAME
  1510.     FreeAllMem - frees all memory allocated by the calling task (V11)
  1511.  
  1512.     CPU
  1513.     PowerPC
  1514.  
  1515.     SYNOPSIS
  1516.     FreeAllMem(_PowerPCBase)
  1517.            r3
  1518.  
  1519.     void FreeVecPPC(struct Library *);
  1520.  
  1521.     FUNCTION
  1522.     Frees all memory which was allocated by the calling task. This is an
  1523.     easy way to free the memory rather than calling FreeVecPPC for every
  1524.     allocation made.
  1525.  
  1526.     INPUTS
  1527.     _PowerPCBase - base of powerpc.library
  1528.  
  1529.     SEE ALSO
  1530.     AllocVecPPC,FreeVecPPC,powerpc/memoryPPC.i
  1531.  
  1532. powerpc.library/FreeSemaphorePPC              powerpc.library/FreeSemaphorePPC
  1533.  
  1534.     NAME
  1535.     FreeSemaphorePPC - frees a signal semaphore (V8)
  1536.  
  1537.     CPU
  1538.     PowerPC
  1539.  
  1540.     SYNOPSIS
  1541.     FreeSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  1542.              r3            r4
  1543.  
  1544.     void FreeSemaphorePPC(struct Library *, struct SignalSemaphorePPC *);
  1545.  
  1546.     FUNCTION
  1547.     Frees a signal semaphore initialized by InitSemaphorePPC. There
  1548.     is no similar function in exec.library!
  1549.  
  1550.     INPUTS
  1551.     _PowerPCBase - base of powerpc.library
  1552.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  1553.  
  1554.     SEE ALSO
  1555.     InitSemaphorePPC, ObtainSemaphorePPC, AttemptSemaphorePPC,
  1556.     ReleaseSemaphorePPC, AddSemaphorePPC, RemSemaphorePPC,
  1557.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  1558.  
  1559. powerpc.library/FreeSignalPPC                    powerpc.library/FreeSignalPPC
  1560.  
  1561.     NAME
  1562.     FreeSignalPPC - frees a signal (V8)
  1563.  
  1564.     CPU
  1565.     PowerPC
  1566.  
  1567.     SYNOPSIS
  1568.     FreeSignalPPC(_PowerPCBase, signalNum)
  1569.               r3            r4
  1570.  
  1571.     void FreeSignalPPC(struct Library *, LONG);
  1572.  
  1573.     FUNCTION
  1574.     Frees a signal bit allocated by AllocSignalPPC. This is the
  1575.     mirror function of exec/FreeSignal.
  1576.  
  1577.     INPUTS
  1578.     _PowerPCBase - base of powerpc.library
  1579.     signalNum - the signal bit number to free (0..31). It's
  1580.             safe to pass -1 as input parameter.
  1581.  
  1582.     SEE ALSO
  1583.     AllocSignalPPC, SetSignalPPC, SignalPPC, WaitPPC
  1584.  
  1585. powerpc.library/FreeVecPPC                          powerpc.library/FreeVecPPC
  1586.  
  1587.     NAME
  1588.     FreeVecPPC - frees memory allocated by AllocVecPPC (V7)
  1589.  
  1590.     CPU
  1591.     PowerPC
  1592.  
  1593.     SYNOPSIS
  1594.     status = FreeVecPPC(_PowerPCBase, memblock)
  1595.     r3                  r3            r4
  1596.  
  1597.     LONG FreeVecPPC(struct Library *, void *);
  1598.  
  1599.     FUNCTION
  1600.     Frees memory allocated by AllocVecPPC. This is the mirror function
  1601.     of exec/FreeVec.
  1602.  
  1603.     INPUTS
  1604.     _PowerPCBase - base of powerpc.library
  1605.     memblock - address of memory to be freed. It's safe to pass NULL
  1606.            as input parameter.
  1607.  
  1608.     RESULT
  1609.     status - a status value:
  1610.         MEMERR_SUCCESS - operation was successful
  1611.  
  1612.     NOTES
  1613.     It is absolutely required that no part of the freed memory is
  1614.     located in the 68K data cache! This is only important if your
  1615.     application is working asynchronously and shares data between
  1616.     independent 68K and PPC tasks. Otherwise (for standard synchron
  1617.     applications) it is guaranteed that the 68K data cache doesn't
  1618.     contain parts of the freed memory.
  1619.  
  1620.     The same rules also apply to the reverse case (free memory
  1621.     using exec/FreeVec).
  1622.  
  1623.     SEE ALSO
  1624.     AllocVecPPC, FreeAllMem, powerpc/memoryPPC.i
  1625.  
  1626. powerpc.library/FreeXMsgPPC                        powerpc.library/FreeXMsgPPC
  1627.  
  1628.     NAME
  1629.     FreeXMsgPPC - frees a message allocated with 'AllocXMsgPPC' (V12)
  1630.  
  1631.     CPU
  1632.     PowerPC
  1633.  
  1634.     SYNOPSIS
  1635.     FreeXMsgPPC(_PowerPCBase, message)
  1636.              r3           r4
  1637.  
  1638.     void FreeXMsgPPC(struct Library *, struct Message *);
  1639.  
  1640.     FUNCTION
  1641.     This function frees a memory allocated using 'AllocXMsgPPC'.
  1642.  
  1643.     INPUTS
  1644.     _PowerPCBase - base of powerpc.library
  1645.     message - a message allocated by 'AllocXMsgPPC'.
  1646.  
  1647.     NOTES
  1648.     There were some restrictions in earlier versions using
  1649.     FreeXMsgPPC. Since V14, a XMessage created by AllocXMsgPPC can be
  1650.     freed either by another PPC task (if the message isn't used
  1651.     anymore) or by a 68K task using FreeXMsg.
  1652.  
  1653.     SEE ALSO
  1654.     AllocXMsgPPC, PutXMsgPPC
  1655.  
  1656. powerpc.library/GetHALInfo                          powerpc.library/GetHALInfo
  1657.  
  1658.     NAME
  1659.     GetHALInfo - evaluates some HAL related information (V14)
  1660.  
  1661.     CPU
  1662.     PowerPC
  1663.  
  1664.     SYNOPSIS
  1665.     GetHALInfo(_PowerPCBase, HALInfoTagList)
  1666.            r3            r4
  1667.  
  1668.     void GetHALInfo(struct Library *, struct TagItem *);
  1669.  
  1670.     FUNCTION
  1671.     This function is able to evaluate some information related to
  1672.     the WarpUp-HAL' status. The values which should be evaluated are
  1673.     specified using the appropriate tags (defined in powerpc/powerpc.i)
  1674.     and the value is returned in the appropriate ti_Data field.
  1675.  
  1676.     INPUTS
  1677.     _PowerPCBase - base of powerpc.library
  1678.     HALInfoTagList - pointer to a tagitem array. The following tags are
  1679.              supported:
  1680.         HINFO_ALEXC_HIGH:   returns the high-longword of a 64-bit-value
  1681.                 showing the number of emulated alignment
  1682.                 exceptions since the PowerPC was reset.
  1683.         HINFO_ALEXC_LOW:    returns the low-longword of a 64-bit-value
  1684.                 showing the number of emulated alignment
  1685.                 exceptions since the PowerPC was reset.
  1686.  
  1687.     NOTES
  1688.     If the number of emulated alignment exceptions should be evaluated
  1689.     for specific tasks, you should use the tc_Switch/tc_Launch fields
  1690.     of the WarpOS task structure to keep track of task switches.
  1691.  
  1692.     This function is safe to call from exception handlers.
  1693.  
  1694.     SEE ALSO
  1695.     powerpc/powerpc.i
  1696.  
  1697. powerpc.library/GetInfo                                powerpc.library/GetInfo
  1698.  
  1699.     NAME
  1700.     GetInfo - evaluates many CPU related information (V10)
  1701.  
  1702.     CPU
  1703.     PowerPC
  1704.  
  1705.     SYNOPSIS
  1706.     GetInfo(_PowerPCBase, PPCInfoTagList)
  1707.         r3            r4
  1708.  
  1709.     void GetInfo(struct Library *, struct TagItem *);
  1710.  
  1711.     FUNCTION
  1712.     This function is able to evaluate many CPU related information
  1713.     such as CPU type, cache states and more. The values which should
  1714.     be evaluated are specified using the appropriate tags (defined
  1715.     in powerpc/powerpc.i) and the value is returned in the appropriate
  1716.     ti_Data field.
  1717.  
  1718.     INPUTS
  1719.     _PowerPCBase - base of powerpc.library
  1720.     PPCInfoTagList - pointer to a tagitem array. The following tags are
  1721.              supported:
  1722.         PPCINFO_CPU:        evaluates the PowerPC CPU type (see powerpc/
  1723.                 powerpc.i for a description of the possible
  1724.                 return values)
  1725.         PPCINFO_PVR:        returns the PVR register which also contains
  1726.                 the revision number of the CPU besides the
  1727.                 CPU type.
  1728.         PPCINFO_ICACHE:     returns the state of the instruction cache
  1729.                 See powerpc/powerpc.i for a description of
  1730.                 the possible values.
  1731.         PPCINFO_DCACHE:     returns the state of the data cache. The
  1732.                 values possible are the same as for PPCINFO_
  1733.                 ICACHE.
  1734.         PPCINFO_PAGETABLE:  returns the location of the standard page table
  1735.         PPCINFO_TABLESIZE:  returns the size of the page table (in KBytes)
  1736.         PPCINFO_BUSCLOCK:   returns the bus clock value (in Hz)
  1737.         PPCINFO_CPUCLOCK:   returns the CPU clock value (in Hz)
  1738.  
  1739.     NOTES
  1740.     The CPU clock cannot be evaluated on PowerPC systems without the
  1741.     extension E (for example PPC603,PPC604) because the supervisor
  1742.     register HID1 is missing. In this case, 0 is returned.
  1743.  
  1744.     Usually the PPC-CPU's available for AMIGA will have this register
  1745.     (for example: PPC603E, PPC604E)
  1746.  
  1747.     SEE ALSO
  1748.     powerpc/powerpc.i
  1749.  
  1750. powerpc.library/GetMsgPPC                            powerpc.library/GetMsgPPC
  1751.  
  1752.     NAME
  1753.     GetMsgPPC - get next message from a message port (V11)
  1754.  
  1755.     CPU
  1756.     PowerPC
  1757.  
  1758.     SYNOPSIS
  1759.     message = GetMsgPPC(_PowerPCBase, MsgPortPPC)
  1760.     r3                  r3            r4
  1761.  
  1762.     struct Message *GetMsgPPC(struct Library *, struct MsgPortPPC *);
  1763.  
  1764.     FUNCTION
  1765.     This function receives a message from a given message port. This
  1766.     is the mirror function of exec/GetMsg.
  1767.  
  1768.     INPUTS
  1769.     _PowerPCBase - base of powerpc.library
  1770.     port - a pointer to a message port
  1771.  
  1772.     RESULTS
  1773.     message - a pointer to the first available message or NULL if none
  1774.           is available.
  1775.  
  1776.     SEE ALSO
  1777.     WaitPortPPC, PutMsgPPC, ReplyMsgPPC, powerpc/portsPPC.i
  1778.  
  1779. powerpc.library/GetSysTimePPC                    powerpc.library/GetSysTimePPC
  1780.  
  1781.     NAME
  1782.     GetSysTimePPC - get the current (relative) time (V7)
  1783.  
  1784.     CPU
  1785.     PowerPC
  1786.  
  1787.     SYNOPSIS
  1788.     GetSysTimePPC(_PowerPCBase, Dest )
  1789.                 r3      r4
  1790.  
  1791.     void GetSysTimePPC(struct Library *, struct timeval * );
  1792.  
  1793.     FUNCTION
  1794.     Returns the current system time. This time is NOT absolute, there
  1795.     is no relation between the real time and the time returned by
  1796.     GetSysTimePPC. This function can be used for measurement of
  1797.     time spans.
  1798.  
  1799.     This is the mirror function of timer/GetSysTime.
  1800.  
  1801.     INPUTS
  1802.     _PowerPCBase - base of powerpc.library
  1803.     Dest - pointer to a timeval structure (where the time is stored)
  1804.  
  1805.     NOTES
  1806.     This function has different behaviour on powerpc.library V7 and
  1807.     powerpc.library V8+.
  1808.  
  1809.     V7: The time is evaluated using the timer.device (via a cross
  1810.     call) because it isn't possible to evaluate the busclock frequency
  1811.     of the PPC with V7 (and ppc.library below) until now.
  1812.  
  1813.     V8+: The time is evaluated completely native (and fast) using the
  1814.     internal timers and the busclock frequency evaluated by WarpOS.
  1815.  
  1816.     This function is safe to call from exception handlers ONLY in
  1817.     powerpc.library V8 and higher !!
  1818.  
  1819.     SEE ALSO
  1820.     AddTimePPC, SubTimePPC, CmpTimePPC
  1821.  
  1822. powerpc.library/GetTagDataPPC                    powerpc.library/GetTagDataPPC
  1823.  
  1824.     NAME
  1825.     GetTagDataPPC - obtain the data corresponding to a tag (V8)
  1826.  
  1827.     CPU
  1828.     PowerPC
  1829.  
  1830.     SYNOPSIS
  1831.     value = GetTagDataPPC(_PowerPCBase, tagValue, defaultVal, tagList)
  1832.     r3                    r3            r4        r5          r6
  1833.  
  1834.     ULONG *GetTagDataPPC(struct Library *, ULONG, ULONG, struct TagItem* );
  1835.  
  1836.     FUNCTION
  1837.     Searches a tag list for a matching tag and returns the corresponding
  1838.     ti_Data value for the TagItem found. If no match is found,
  1839.     this function returns the value passed in as 'defaultVal'. This
  1840.     is the mirror function of utility/GetTagData.
  1841.  
  1842.     INPUTS
  1843.     _PowerPCBase - base of powerpc.library
  1844.     tagValue - tag value to search for
  1845.     defaultVal - value to be returned if tagValue is not found
  1846.     tagList - tag item list to search (may be NULL)
  1847.  
  1848.     RESULT
  1849.     value - the ti_Data value for the first matching TagItem, or
  1850.         'defaultVal' if a ti_Tag matching Tag is not found.
  1851.  
  1852.     NOTES
  1853.     This function is safe to call from exception handlers.
  1854.  
  1855.     SEE ALSO
  1856.     FindTagItemPPC, NextTagItemPPC, utility/tagitem.i
  1857.  
  1858. powerpc.library/GetTaskByID                        powerpc.library/GetTaskByID
  1859.  
  1860.     NAME
  1861.     GetTaskByID - evaluates the task address for a given task ID (V14)
  1862.  
  1863.     CPU
  1864.     PowerPC
  1865.  
  1866.     SYNOPSIS
  1867.     TaskPPC = GetTaskByID(_PowerPCBase, taskID)
  1868.     r3                    r3            r4
  1869.  
  1870.     ULONG *GetTagDataPPC(struct Library *, ULONG, ULONG, struct TagItem* );
  1871.  
  1872.     FUNCTION
  1873.     Searches a tag list for a matching tag and returns the corresponding
  1874.     ti_Data value for the TagItem found. If no match is found,
  1875.     this function returns the value passed in as 'defaultVal'. This
  1876.     is the mirror function of utility/GetTagData.
  1877.  
  1878.     INPUTS
  1879.     _PowerPCBase - base of powerpc.library
  1880.     tagValue - tag value to search for
  1881.     defaultVal - value to be returned if tagValue is not found
  1882.     tagList - tag item list to search (may be NULL)
  1883.  
  1884.     RESULT
  1885.     value - the ti_Data value for the first matching TagItem, or
  1886.         'defaultVal' if a ti_Tag matching Tag is not found.
  1887.  
  1888.     NOTES
  1889.     This function is safe to call from exception handlers.
  1890.  
  1891.     SEE ALSO
  1892.     FindTagItemPPC, NextTagItemPPC, utility/tagitem.i
  1893.  
  1894. powerpc.library/InitSemaphorePPC              powerpc.library/InitSemaphorePPC
  1895.  
  1896.     NAME
  1897.     InitSemaphorePPC - initializes a signal semaphore (V8)
  1898.  
  1899.     CPU
  1900.     PowerPC
  1901.  
  1902.     SYNOPSIS
  1903.     status = InitSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  1904.     r3                        r3            r4
  1905.  
  1906.     LONG InitSemaphorePPC(struct Library *, struct SignalSemaphorePPC *);
  1907.  
  1908.     FUNCTION
  1909.     Initializes a signal semaphore. This is the mirror function of
  1910.     exec/InitSemaphore with some changes.
  1911.  
  1912.     INPUTS
  1913.     _PowerPCBase - base of powerpc.library
  1914.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  1915.                  (all fields to zero)
  1916.  
  1917.     RESULT
  1918.     status - status value:
  1919.         SSPPC_SUCCESS: function was successful
  1920.         SSPPC_NOMEM: function failed due to lack of memory
  1921.  
  1922.     NOTES
  1923.     In opposite to exec/InitSemaphore a signal semaphore for PPC
  1924.     has to be freed with FreeSemaphorePPC, because InitSemaphorePPC
  1925.     allocates memory which should be freed after use.
  1926.  
  1927.     SEE ALSO
  1928.     FreeSemaphorePPC, ObtainSemaphorePPC, AttemptSemaphorePPC,
  1929.     ReleaseSemaphorePPC, AddSemaphorePPC, RemSemaphorePPC,
  1930.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  1931.  
  1932. powerpc.library/InsertPPC                            powerpc.library/InsertPPC
  1933.  
  1934.     NAME
  1935.     InsertPPC - insert a node into a list (V8)
  1936.  
  1937.     CPU
  1938.     PowerPC
  1939.  
  1940.     SYNOPSIS
  1941.     Insert(_PowerPCBase, list, node, nodepredecessor)
  1942.            r3            r4    r5    r6
  1943.  
  1944.     void InsertPPC(struct Library *, struct List*, struct Node*,
  1945.                struct Node*);
  1946.  
  1947.     FUNCTION
  1948.     Insert a node into an standard exec list. This is the mirror
  1949.     function of exec/Insert.
  1950.  
  1951.     INPUTS
  1952.     _PowerPCBase - base of powerpc.library (can be omitted)
  1953.     list - a pointer to the target list
  1954.     node - the node to insert
  1955.     nodepredecessor - the node after which to insert. If 0 is passed,
  1956.               the node is inserted at the head of the list.
  1957.  
  1958.     NOTES
  1959.     This function is guaranteed to work correctly, if the PowerPCBase
  1960.     is not passed in r3.
  1961.  
  1962.     This function is safe to call from exception handlers.
  1963.  
  1964.     SEE ALSO
  1965.     AddHeadPPC, AddTailPPC, RemovePPC, RemHeadPPC, RemTailPPC,
  1966.     EnqueuePPC, FindNamePPC, powerpc/listsPPC.i
  1967.  
  1968. powerpc.library/LockTaskList                      powerpc.library/LockTaskList
  1969.  
  1970.     NAME
  1971.     LockTaskList - locks a list of all tasks (V10)
  1972.  
  1973.     CPU
  1974.     PowerPC
  1975.  
  1976.     SYNOPSIS
  1977.     TaskPtr = LockTaskList(_PowerPCBase)
  1978.     r3                     r3
  1979.  
  1980.     struct TaskPtr* LockTaskList(struct Library *);
  1981.  
  1982.     FUNCTION
  1983.     This function locks a list of all PPC tasks currently available.
  1984.     The main purpose of this function is to allow examining the
  1985.     PPCtask structures without to worry about protecting the access
  1986.     by semaphores (this is done internally).
  1987.  
  1988.     The usual method of accessing the task information is the
  1989.     following:
  1990.  
  1991.     - Lock the task list using 'LockTaskList'
  1992.     - Get the pointer to the first task (by reading out the entry
  1993.       TASKPTR_TASK of the returned TaskPtr structure)
  1994.     - Scan trough the list and read out all infomation you need until
  1995.       you find the end of the list
  1996.     - Unlock the list using 'UnLockTaskList'
  1997.  
  1998.     INPUTS
  1999.     _PowerPCBase - base of powerpc.library
  2000.  
  2001.     RESULTS
  2002.     TaskPtr - Ptr to the first node of a list of TaskPtr structures
  2003.           (see powerpc/tasksppc.i)
  2004.  
  2005.     NOTES
  2006.     The WarpOS multitasking is NOT halted between LockTaskList and
  2007.     UnLockTaskList.
  2008.  
  2009.     No new tasks are created and no resources of removed tasks are
  2010.     freed between LockTaskList and UnLockTaskList. So don't lock the
  2011.     list for a too long time.
  2012.  
  2013.     SEE ALSO
  2014.     UnLockTaskList, powerpc/tasksppc.i
  2015.  
  2016. powerpc.library/ModifyFPExc                        powerpc.library/ModifyFPExc
  2017.  
  2018.     NAME
  2019.     ModifyFPExc - enables/disables specific floating point exceptions (V9)
  2020.  
  2021.     CPU
  2022.     PowerPC
  2023.  
  2024.     SYNOPSIS
  2025.     ModifyFPExc(_PowerPCBase, FPflags)
  2026.             r3            r4
  2027.  
  2028.     void ModifyFPExc(struct Library *, ULONG);
  2029.  
  2030.     FUNCTION
  2031.     This function allows to enable/disable particular floating
  2032.     point exceptions. Multiple exceptions can be affected
  2033.     simultaneously.
  2034.  
  2035.     INPUTS
  2036.     _PowerPCBase - base of powerpc.library
  2037.     FPflags - action to be performed:
  2038.         FPF_EN_OVERFLOW:    Enables FP overflow exception
  2039.         FPF_EN_UNDERFLOW:   Enables FP underflow exception
  2040.         FPF_EN_ZERODIVIDE:  Enables FP zero divide exception
  2041.         FPF_EN_INEXACT:     Enables FP inexact operation exception
  2042.         FPF_EN_INVALID:     Enables FP invalid operation exception
  2043.         FPF_DIS_OVERFLOW:   Disables FP overflow exception
  2044.         FPF_DIS_UNDERFLOW:  Disables FP underflow exception
  2045.         FPF_DIS_ZERODIVIDE: Disables FP zero divide exception
  2046.         FPF_DIS_INEXACT:    Disables FP inexact operation exception
  2047.         FPF_DIS_INVALID:    Disables FP invalid operation exception
  2048.  
  2049.     NOTES
  2050.     Floating point exceptions must be enabled globally using 'SetHardware'
  2051.     otherwise this function doesn't have any effect.
  2052.  
  2053.     SEE ALSO
  2054.     SetHardware, powerpc/powerpc.i
  2055.  
  2056. powerpc.library/NextTagItemPPC                  powerpc.library/NextTagItemPPC
  2057.  
  2058.     NAME
  2059.     NextTagItemPPC - iterate through a tag list (V8)
  2060.  
  2061.     CPU
  2062.     PowerPC
  2063.  
  2064.     SYNOPSIS
  2065.     tag = NextTagItemPPC(_PowerPCBase, tagItemPtr)
  2066.     r3                   r3            r4
  2067.  
  2068.     struct TagItem *NextTagItemPPC(struct Library *, struct TagItem **);
  2069.  
  2070.     FUNCTION
  2071.     Iterates through a tag list, skipping and chaining as dictated by
  2072.     system tags. Each call returns either the next item to be examined
  2073.     or NULL when the end of the list has benn reached. This is the
  2074.     mirror function of utility/NextTagItem.
  2075.  
  2076.     INPUTS
  2077.     _PowerPCBase - base of powerpc.library
  2078.     tagItemPtr - double-indirect reference to a TagItem structure.
  2079.              The pointer will be changed to keep track of the
  2080.              iteration.
  2081.  
  2082.     RESULT
  2083.     tag - each TagItem in the array that should be processed is
  2084.           returned in turn with succesive calls.
  2085.  
  2086.     NOTES
  2087.     This function is safe to call from exception handlers.
  2088.  
  2089.     SEE ALSO
  2090.     FindTagItemPPC, GetTagDataPPC, utility/tagitem.i
  2091.  
  2092. powerpc.library/ObtainSemaphorePPC          powerpc.library/ObtainSemaphorePPC
  2093.  
  2094.     NAME
  2095.     ObtainSemaphorePPC - gain exclusive access to a semaphore (V8)
  2096.  
  2097.     CPU
  2098.     PowerPC
  2099.  
  2100.     SYNOPSIS
  2101.     ObtainSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  2102.                r3            r4
  2103.  
  2104.     void ObtainSemaphorePPC(struct Library *, struct SignalSemaphorePPC *);
  2105.  
  2106.     FUNCTION
  2107.     Tries to get exclusive access to a signal semaphore. If the semaphore
  2108.     is occupied, the task adds itself into a waiting queue. This is the
  2109.     mirror function of exec/ObtainSemaphore.
  2110.  
  2111.     INPUTS
  2112.     _PowerPCBase - base of powerpc.library
  2113.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  2114.  
  2115.     NOTES
  2116.     This call is guaranteed to preserve all GPR (except r0) and the CTR.
  2117.  
  2118.     SEE ALSO
  2119.     InitSemaphorePPC, FreeSemaphorePPC, AttemptSemaphorePPC,
  2120.     ReleaseSemaphorePPC, AddSemaphorePPC, RemSemaphorePPC
  2121.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  2122.  
  2123. powerpc.library/PutMsgPPC                            powerpc.library/PutMsgPPC
  2124.  
  2125.     NAME
  2126.     PutMsgPPC - put a message to a message port (V11)
  2127.  
  2128.     CPU
  2129.     PowerPC
  2130.  
  2131.     SYNOPSIS
  2132.     PutMsgPPC(_PowerPCBase, MsgPortPPC, message)
  2133.           r3            r4          r5
  2134.  
  2135.     void PutMsgPPC(struct Library *, struct MsgPortPPC *, struct Messge *);
  2136.  
  2137.     FUNCTION
  2138.     This function attaces a message to the end of the given port. In
  2139.     opposition to exec/PutMsg, only ports with PA_SIGNAL are supported.
  2140.     This is the mirror function of exec/PutMsg.
  2141.  
  2142.     INPUTS
  2143.     _PowerPCBase - base of powerpc.library
  2144.     port - a pointer to a message port
  2145.     message - a pointer to the message to be sent
  2146.  
  2147.     NOTES
  2148.     This function is safe to call from exception handlers.
  2149.  
  2150.     SEE ALSO
  2151.     WaitPortPPC, GetMsgPPC, ReplyMsgPPC, powerpc/portsPPC.i
  2152.  
  2153. powerpc.library/PutXMsgPPC                          powerpc.library/PutXMsgPPC
  2154.  
  2155.     NAME
  2156.     PutXMsgPPC - sends an Inter-CPU message to a 68K task (V12)
  2157.  
  2158.     CPU
  2159.     PowerPC
  2160.  
  2161.     SYNOPSIS
  2162.     PutXMsgPPC(_PowerPCBase, MsgPort, message)
  2163.            r3            r4       r5
  2164.  
  2165.     void PutXMsgPPC(struct Library *, struct MsgPort *, struct Message *);
  2166.  
  2167.     FUNCTION
  2168.     This function sends an Inter-CPU message allocated by 'AllocXMsgPPC'
  2169.     to a 68K task.
  2170.  
  2171.     INPUTS
  2172.     _PowerPCBase - base of powerpc.library
  2173.     MsgPort - an exec message port
  2174.     message - a message allocated by 'AllocXMsgPPC'.
  2175.  
  2176.     NOTES
  2177.     Inter-CPU must NOT be used for internal communication. They can
  2178.     only be used for communication between tasks on different processors.
  2179.  
  2180.     Inter-CPU messages get a different node type, if they are
  2181.     sent. If you want to filter out Reply-Messages from standard
  2182.     or Inter-CPU messages, compare the LN_TYPE field to NT_REPLYMSG.
  2183.     Replied Inter-CPU messages still get the same node type
  2184.     (NT_REPLYMSG). Any assumptions about the value of the new
  2185.     node type are ILLEGAL!!
  2186.  
  2187.     As soon as an Inter-CPU message is sent, the PPC looses ownership
  2188.     over the message. No access to the message is allowed until the
  2189.     reply has been arrived. If no replyport was specified, it's
  2190.     allowed to free the message, after it was read from the other side.
  2191.  
  2192.     Inter-CPU messages can be reused if they have been replied.
  2193.  
  2194.     Inter-CPU messages are read and replied using the standard
  2195.     message handling mechanisms (exec/WaitPort,exec/GetMsg,exec/ReplyMsg
  2196.     for 68K, powerpc/WaitPortPPC, powerpc/GetMsgPPC, powerpc/ReplyMsgPPC
  2197.     for PPC).
  2198.  
  2199.     The receiving task must NOT access message data, which are not
  2200.     explicitely located in the message body (for example data which is
  2201.     referenced by a pointer) unless both tasks care for the cache
  2202.     consistency. Only the message itself is flushed/invalidated
  2203.     automatically by the system.
  2204.  
  2205.     The receiving task may write to the message body of an Inter-CPU
  2206.     message.
  2207.  
  2208.     SEE ALSO
  2209.     AllocXMsgPPC, FreeXMsgPPC
  2210.  
  2211. powerpc.library/ReleaseSemaphorePPC        powerpc.library/ReleaseSemaphorePPC
  2212.  
  2213.     NAME
  2214.     ReleaseSemaphorePPC - make signal semaphore available to others (V8)
  2215.  
  2216.     CPU
  2217.     PowerPC
  2218.  
  2219.     SYNOPSIS
  2220.     ReleaseSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  2221.                 r3            r4
  2222.  
  2223.     void ReleaseSemaphorePPC(struct Library *,
  2224.                  struct SignalSemaphorePPC *);
  2225.  
  2226.     FUNCTION
  2227.     Releases a semaphore locked by either ObtainSemaphorePPC or
  2228.     AttemptSemaphorePPC. If other tasks are waiting, the foremost
  2229.     in the waiting queue is waked up.
  2230.  
  2231.     INPUTS
  2232.     _PowerPCBase - base of powerpc.library
  2233.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  2234.  
  2235.     NOTES
  2236.     This call is guaranteed to preserve all GPR (except r0) and the CTR.
  2237.  
  2238.     If the semaphore is in an illegal state after calling
  2239.     ReleaseSemaphorePPC, a system message will appear and the task is
  2240.     put into waiting state.
  2241.  
  2242.     SEE ALSO
  2243.     InitSemaphorePPC, FreeSemaphorePPC, ObtainSemaphorePPC,
  2244.     AttemptSemaphorePPC, AddSemaphorePPC, RemSemaphorePPC
  2245.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  2246.  
  2247. powerpc.library/RemExcHandler                    powerpc.library/RemExcHandler
  2248.  
  2249.     NAME
  2250.     RemExcHandler - removes a custom exception handler (V9)
  2251.  
  2252.     CPU
  2253.     PowerPC
  2254.  
  2255.     SYNOPSIS
  2256.     RemExcHandler(_PowerPCBase, XLock)
  2257.               r3            r4
  2258.  
  2259.     void RemExcHandler(struct Library *, void *);
  2260.  
  2261.     FUNCTION
  2262.     Removes an exception handler inserted by the function SetExcHandler.
  2263.  
  2264.     INPUTS
  2265.     _PowerPCBase - base of powerpc.library
  2266.     XLock - The lock value returned by SetExcHandler. It's safe to pass
  2267.         NULL as parameter
  2268.  
  2269.     SEE ALSO
  2270.     RemExcHandler, powerpc/powerpc.i
  2271.  
  2272. powerpc.library/RemHeadPPC                          powerpc.library/RemHeadPPC
  2273.  
  2274.     NAME
  2275.     RemHeadPPC - removes the head node from a list (V8)
  2276.  
  2277.     CPU
  2278.     PowerPC
  2279.  
  2280.     SYNOPSIS
  2281.     node = RemHeadPPC(_PowerPCBase, list)
  2282.     r3                r3            r4
  2283.  
  2284.     struct Node *RemHeadPPC(struct Library *, struct List*);
  2285.  
  2286.     FUNCTION
  2287.     Removes the head node of a list. This is the mirror function of
  2288.     exec/RemHead.
  2289.  
  2290.     INPUTS
  2291.     _PowerPCBase - base of powerpc.library (can be omitted)
  2292.     list - the target list from which the head node should be removed
  2293.  
  2294.     RESULT
  2295.     node - the node removed or 0 if the list was empty
  2296.  
  2297.     NOTES
  2298.     This function is guaranteed to work correctly, if the PowerPCBase
  2299.     is not passed in r3.
  2300.  
  2301.     Assembler programmers may use the macro _REMHEAD located in
  2302.     'powerpc/listsPPC.i'
  2303.  
  2304.     This function is safe to call from exception handlers.
  2305.  
  2306.     SEE ALSO
  2307.     InsertPPC, AddTailPPC, AddHeadPPC, RemovePPC, RemTailPPC,
  2308.     EnqueuePPC, FindNamePPC, powerpc/listsPPC.i
  2309.  
  2310. powerpc.library/RemovePPC                            powerpc.library/RemovePPC
  2311.  
  2312.     NAME
  2313.     RemovePPC - removes a node from a list (V8)
  2314.  
  2315.     CPU
  2316.     PowerPC
  2317.  
  2318.     SYNOPSIS
  2319.     RemovePPC(_PowerPCBase, node)
  2320.            r3           r4
  2321.  
  2322.     void RemovePPC(struct Library *, struct Node*);
  2323.  
  2324.     FUNCTION
  2325.     Removes a node from whatever list it is in. This is the mirror
  2326.     function of exec/Remove.
  2327.  
  2328.     INPUTS
  2329.     _PowerPCBase - base of powerpc.library (can be omitted)
  2330.     node - the node to remove
  2331.  
  2332.     NOTES
  2333.     This function is guaranteed to work correctly, if the PowerPCBase
  2334.     is not passed in r3.
  2335.  
  2336.     Assembler programmers may use the macro _REMOVE located in
  2337.     'powerpc/listsPPC.i'
  2338.  
  2339.     This function is safe to call from exception handlers.
  2340.  
  2341.     SEE ALSO
  2342.     InsertPPC, AddTailPPC, AddHeadPPC, RemHeadPPC, RemTailPPC,
  2343.     EnqueuePPC, FindNamePPC, powerpc/listsPPC.i
  2344.  
  2345. powerpc.library/RemPortPPC                          powerpc.library/RemPortPPC
  2346.  
  2347.     NAME
  2348.     RemPortPPC - removes a public PPC message port from the system (V11)
  2349.  
  2350.     CPU
  2351.     PowerPC
  2352.  
  2353.     SYNOPSIS
  2354.     RemPortPPC(_PowerPCBase, MsgPortPPC)
  2355.            r3            r4
  2356.  
  2357.     void RemPortPPC(struct Library *, struct MsgPortPPC *);
  2358.  
  2359.     FUNCTION
  2360.     This function removes a public message port from the global list
  2361.     of message ports. It is the mirror function of exec/RemPort.
  2362.  
  2363.     INPUTS
  2364.     _PowerPCBase - base of powerpc.library
  2365.     MsgPortPPC - pointer to a PPC message port. It's safe to pass a NULL
  2366.              parameter.
  2367.  
  2368.     SEE ALSO
  2369.     CreateMsgPortPPC,DeleteMsgPortPPC,FindPortPPC,AddPortPPC
  2370.     powerpc/portsPPC.i
  2371.  
  2372. powerpc.library/RemTailPPC                          powerpc.library/RemTailPPC
  2373.  
  2374.     NAME
  2375.     RemTailPPC - removes the tail node from a list (V8)
  2376.  
  2377.     CPU
  2378.     PowerPC
  2379.  
  2380.     SYNOPSIS
  2381.     node = RemTailPPC(_PowerPCBase, list)
  2382.     r3                r3            r4
  2383.  
  2384.     struct Node *RemTailPPC(struct Library *, struct List*);
  2385.  
  2386.     FUNCTION
  2387.     Removes the tail node of a list. This is the mirror function of
  2388.     exec/RemTail.
  2389.  
  2390.     INPUTS
  2391.     _PowerPCBase - base of powerpc.library (can be omitted)
  2392.     list - the target list from which the tail node should be removed
  2393.  
  2394.     RESULT
  2395.     node - the node removed or 0 if the list was empty
  2396.  
  2397.     NOTES
  2398.     This function is guaranteed to work correctly, if the PowerPCBase
  2399.     is not passed in r3.
  2400.  
  2401.     Assembler programmers may use the macro _REMTAIL located in
  2402.     'powerpc/listsPPC.i'
  2403.  
  2404.     This function is safe to call from exception handlers.
  2405.  
  2406.     SEE ALSO
  2407.     InsertPPC, AddTailPPC, AddHeadPPC, RemovePPC, RemHeadPPC,
  2408.     EnqueuePPC, FindNamePPC, powerpc/listsPPC.i
  2409.  
  2410. powerpc.library/RemSemaphorePPC                powerpc.library/RemSemaphorePPC
  2411.  
  2412.     NAME
  2413.     RemSemaphorePPC - removes a global signal semaphore (V8)
  2414.  
  2415.     CPU
  2416.     PowerPC
  2417.  
  2418.     SYNOPSIS
  2419.     RemSemaphorePPC(_PowerPCBase, SignalSemaphorePPC)
  2420.             r3            r4
  2421.  
  2422.     void RemSemaphorePPC(struct Library *, struct SignalSemaphorePPC *);
  2423.  
  2424.     FUNCTION
  2425.     Removes a global signal semaphore created by AddSemaphorePPC. This
  2426.     is the mirror function of exec/RemSemaphore.
  2427.  
  2428.     INPUTS
  2429.     _PowerPCBase - base of powerpc.library
  2430.     SignalSemaphorePPC - pointer to a signalsemaphorePPC structure
  2431.  
  2432.     SEE ALSO
  2433.     InitSemaphorePPC, FreeSemaphorePPC, ObtainSemaphorePPC,
  2434.     AttemptSemaphorePPC, ReleaseSemaphorePPC, AddSemaphorePPC,
  2435.     FindSemaphorePPC, powerpc/semaphoresPPC.i
  2436.  
  2437. powerpc.library/ReplyMsgPPC                        powerpc.library/ReplyMsgPPC
  2438.  
  2439.     NAME
  2440.     ReplyMsgPPC - put a message to its reply port (V11)
  2441.  
  2442.     CPU
  2443.     PowerPC
  2444.  
  2445.     SYNOPSIS
  2446.     ReplyMsgPPC(_PowerPCBase, message)
  2447.             r3            r4
  2448.  
  2449.     void ReplyMsgPPC(struct Library *, struct Messge *);
  2450.  
  2451.     FUNCTION
  2452.     This function sends a message to its reply port, if one is present.
  2453.     This is the mirror function of exec/ReplyMsg.
  2454.  
  2455.     INPUTS
  2456.     _PowerPCBase - base of powerpc.library
  2457.     message - a pointer to the message to be replied
  2458.  
  2459.     NOTES
  2460.     This function is safe to call from exception handlers.
  2461.  
  2462.     SEE ALSO
  2463.     WaitPortPPC, PutMsgPPC, GetMsgPPC, powerpc/portsPPC.i
  2464.  
  2465. powerpc.library/Run68K                                  powerpc.library/Run68K
  2466.  
  2467.     NAME
  2468.     Run68K - runs a 680x0 function resp. AMIGA-OS library function (V7)
  2469.  
  2470.     CPU
  2471.     PowerPC
  2472.  
  2473.     SYNOPSIS
  2474.     status = Run68K(_PowerPCBase, PPStruct )
  2475.     r3              r3           r4
  2476.  
  2477.     LONG RunPPC (struct Library *, struct PowerPC *);
  2478.  
  2479.     FUNCTION
  2480.     Runs a 680x0 function or an AMIGA-OS library function. All registers
  2481.     can be transferred to 68K as well as parameters on stack. All cache
  2482.     management actions are handled automatically.
  2483.  
  2484.     All registers are transferred back from 68K after the 68K call
  2485.     is completed. They are stored in the PowerPC structure.
  2486.  
  2487.     See RunPPC for the register assignment.
  2488.  
  2489.     INPUTS
  2490.     _PowerPCBase - base of powerpc.library
  2491.     PPStruct - Pointer to an initialized PowerPC Structure
  2492.  
  2493.       PP_CODE       : Pointer to the 680x0 code resp. pointer to the
  2494.               library base (if PP_OFFSET is not zero).
  2495.       PP_OFFSET     : Library offset or 0 if no library function is
  2496.               called.
  2497.       PP_FLAGS      : Flags which can be ore'd together
  2498.       - PP[F/P]_ASYNC   : call 68K function asynchronely (PPC process
  2499.                   returns immediately)
  2500.       PP_STACKPTR   : Pointer to the arguments on the stack to be
  2501.               transferred. The pointer must point to the top
  2502.               of the calling process' stackframe. The stack area
  2503.               to be transferred is located at offset 24 from this
  2504.               position. If no arguments on stack should be
  2505.               transferred, set this to zero.
  2506.       PP_STACKSIZE  : Size of the stack area to be transferred. If no
  2507.               stack parameters should be transferred, set this
  2508.               to zero.
  2509.       PP_REGS       : Array of longwords where the registers to be
  2510.               transferred can be stored (d0-a6)
  2511.       PP_FREGS      : Array of quadwords (8 bytes) where the FP-registers
  2512.               to be transferred can be stored (fp0-fp7)
  2513.  
  2514.     RESULT
  2515.     status - PPERR_SUCCESS if the call was successfully
  2516.          PPERR_ASYNCERR if a synchrone 68K call was made after an
  2517.                 asynchrone 68K call
  2518.  
  2519.     NOTES
  2520.     Calling a 68K function asynchronely is dangerous. Take care of
  2521.     possible cache conflicts. Avoid calling system functions as much
  2522.     as possible.
  2523.  
  2524.     If an asynchrone 68K call is done, the function WaitFor68K MUST be
  2525.     called ONCE after the call was done. No other 68K call is allowed
  2526.     for this PPC process after an asynchrone 68K call and before a call
  2527.     to WaitFor68K.
  2528.  
  2529.     If an asynchronely called 68K function performs a PPC call, the call
  2530.     is only performed when WaitFor68K is called by the PPC process. Note
  2531.     that the 68K mirror process is still connected to the calling PPC
  2532.     process.
  2533.  
  2534.     DON'T pass arguments on stack when calling a 68K function asynchronely.
  2535.     The stack is most likely to be trashed before it is copied to the 68K
  2536.     stack.
  2537.  
  2538.     Assembler programmers should use the macros RUN68K and
  2539.     RUN68K_XL located in the include file 'powerpc/powerpc.i'
  2540.  
  2541.     SEE ALSO
  2542.     WaitFor68K,powerpc/powerpc.i
  2543.  
  2544. powerpc.library/SetCache                              powerpc.library/SetCache
  2545.  
  2546.     NAME
  2547.     SetCache - cache manipulation function (V8)
  2548.  
  2549.     CPU
  2550.     PowerPC
  2551.  
  2552.     SYNOPSIS
  2553.     SetCache(_PowerPCBase, cacheflags, start, length)
  2554.          r3            r4          r5     r6
  2555.  
  2556.     void SetCache(struct Library *, ULONG, void *, ULONG);
  2557.  
  2558.     FUNCTION
  2559.     This function offers many possibilities to affect the caches of
  2560.     the PPC. It performs the action defined by the cache flags. Only
  2561.     one action can be performed at the same time.
  2562.  
  2563.     INPUTS
  2564.     _PowerPCBase - base of powerpc.library
  2565.     cacheflags - action to be performed:
  2566.         CACHE_DCACHEOFF:    Data cache is disabled. The Cache is flushed
  2567.                 automatically.
  2568.         CACHE_DCACHEON:     Data cache is enabled.
  2569.         CACHE_DCACHELOCK:   Data cache is locked (is ignored if either
  2570.                 'start' or 'length' is zero).
  2571.         CACHE_DCACHEUNLOCK: Data cache is unlocked.
  2572.         CACHE_DCACHEFLUSH:  Data cache is flushed.
  2573.         CACHE_ICACHEOFF:    Instruction cache is disabled.
  2574.         CACHE_ICACHEON:     Instruction cache is enabled.
  2575.         CACHE_ICACHELOCK:   Instruction cache is locked.
  2576.         CACHE_ICACHEUNLOCK: Instruction cache is unlocked.
  2577.         CACHE_ICACHEINV:    Instruction cache is invalidated.
  2578.  
  2579.     start - pointer to the start address of the area to be affected.
  2580.         The following cacheflags support an area specification:
  2581.         CACHE_DCACHELOCK, CACHE_DCACHEFLUSH, CACHE_ICACHEINV
  2582.  
  2583.         if 'start' is 0 the whole address space is affected
  2584.  
  2585.     length - length of the area to be affected (see above for the
  2586.          cache flags which support area specification).
  2587.          if 'length' is 0 the whole address space is affected
  2588.  
  2589.     NOTES
  2590.     Invalidating the whole instruction cache is much more efficient
  2591.     than flushing only a part of it.
  2592.  
  2593.     Flushing the whole data cache is less efficient than flushing
  2594.     a specific area, if this area is not too large.
  2595.  
  2596.     The cacheflag DCACHELOCK requires 'start' and 'length' to be not
  2597.     zero. The area specified is then copied into the data cache and
  2598.     the data cache is locked afterwards.
  2599.  
  2600.     The caches should not be switched on/off resp. locked/unlocked
  2601.     without GOOD justification. Global manipulations of the cache
  2602.     should be avoided. Better affect the cache locally by using
  2603.     AllocVecPPC.
  2604.  
  2605.     This function is safe to call from exception handlers
  2606.  
  2607.     SEE ALSO
  2608.     powerpc/powerpc.i
  2609.  
  2610. powerpc.library/SetExcHandler                    powerpc.library/SetExcHandler
  2611.  
  2612.     NAME
  2613.     SetExcHandler - insert a custom exception handler (V9)
  2614.  
  2615.     CPU
  2616.     PowerPC
  2617.  
  2618.     SYNOPSIS
  2619.     XLock = SetExcHandler(_PowerPCBase, ExcTags)
  2620.     r3                    r3            r4
  2621.  
  2622.     void *SetExcHandler(struct Library *, struct TagItem *);
  2623.  
  2624.     FUNCTION
  2625.     This function allows applications to insert custom exception
  2626.     handlers. Those handlers can be global or task dependant,
  2627.     priorities are also supported. Multiple exceptions can be
  2628.     selected for one exception handler.
  2629.  
  2630.     The exception handlers are executed in supervisor mode and
  2631.     have access to all supervisor registers.
  2632.  
  2633.     The handlers are called in one of two possible ways (dependant
  2634.     of the tag EXC_FLAGS):
  2635.  
  2636.     1) EXC_FLAGS has the flag EXCF_SMALLCONTEXT set:
  2637.  
  2638.  
  2639.        Status = CustomHandler(SmallContext)
  2640.        r3                     r3
  2641.  
  2642.        ULONG CustomHandler(struct XCONTEXT*)
  2643.  
  2644.        Inputs:
  2645.         SmallContext - a pointer to a XCONTEXT structure (see
  2646.                    powerpc/powerpc.i)
  2647.  
  2648.        Result:
  2649.         Status - a return value which decides, whether the
  2650.              exception should be leaved immediately or
  2651.              if following exception handlers should be
  2652.              executed, too (see powerpc/powerpc.i)
  2653.  
  2654.  
  2655.       In this first method, the handler gets all registers directly,
  2656.       except for r3, which is passed in the XCONTEXT structure. The
  2657.       exception ID, which gives information about the kind of
  2658.       exception occurred, is passed also in XCONTEXT structure.
  2659.  
  2660.       All registers which are modified by the exception handler are
  2661.       also modified for the interrupted task. If r3 should be modified
  2662.       for the interrupted task, the appropriate field of the XCONTEXT
  2663.       structure has to be modified.
  2664.  
  2665.       Some of the interrupted task's registers are passed in special
  2666.       supervisor registers. If they should be changed, the appropriate
  2667.       supervisor registers have to be changed:
  2668.  
  2669.       SPRG1 -       The interrupted task's Link Register
  2670.       SPRG2 -       The interrupted task's Stackpointer (r1)
  2671.       SPRG3 -       The interrupted task's Smalldata Base (r2)
  2672.  
  2673.       The exception stack, which is passed in r1, is allocated from the
  2674.       user stack of the interrupted task.
  2675.  
  2676.  
  2677.     2) EXC_FLAGS has the flag EXCF_LARGECONTEXT set:
  2678.  
  2679.  
  2680.        Status = CustomHandler(LargeContext)
  2681.        r3                     r3
  2682.  
  2683.        ULONG CustomHandler(struct EXCCONTEXT*)
  2684.  
  2685.        Inputs:
  2686.         LargeContext - a pointer to a EXCCONTEXT structure (see
  2687.                    powerpc/powerpc.i)
  2688.  
  2689.        Result:
  2690.         Status - a return value which decides, whether the
  2691.              exception should be leaved immediately or
  2692.              if following exception handlers should be
  2693.              executed, too (see powerpc/powerpc.i)
  2694.  
  2695.       In this second method, the handler gets all registers in the
  2696.       EXCCONTEXT structure. If the handler wishes to change some
  2697.       of the register contents it must change the appropriate fields
  2698.       in the EXCCONTEXT structure which are copied back to the
  2699.       registers after the custom handler has completed. If no
  2700.       field is provided for a certain register, it has to be modified
  2701.       directly.
  2702.  
  2703.       The exception stack, which is passed in r1, is allocated from the
  2704.       user stack of the interrupted task.
  2705.  
  2706.     INPUTS
  2707.     _PowerPCBase - base of powerpc.library
  2708.     ExcTags - pointer to a tagitem array. The following tags are
  2709.           supported:
  2710.  
  2711.         EXCATTR_CODE:       pointer to the exception handler code
  2712.                 (required)
  2713.         EXCATTR_DATA:       a user data which is passed in r2 to the
  2714.                 custom exception handler. This is usually
  2715.                 a base register which provides access to
  2716.                 all global data required.
  2717.         EXCATTR_TASK:       specifies the task which is allowed to take
  2718.                 the exception handler. If this tag is 0 or
  2719.                 omitted, the current task is taken instead.
  2720.                 This tag has no effect if the exception
  2721.                 handler is specified as global (see below
  2722.                 at EXCATTR_FLAGS)
  2723.         EXCATTR_EXCID:      Defines which exceptions should call this
  2724.                 exception handler. See powerpc/powerpc.i
  2725.                 for a description of all supported exceptions.
  2726.                 Multiple exceptions can be selected.
  2727.         EXCATTR_FLAGS:
  2728.         EXCF_GLOBAL:       Marks the exception handler as global. It
  2729.                    is then called for every exception occurred.
  2730.         EXCF_LOCAL:        Marks the exception handler as local. It is
  2731.                    then only called, if the interrupted task
  2732.                    matches the task specified in EXCATTR_TASK.
  2733.         EXCF_SMALLCONTEXT: The exception handler is called with a
  2734.                    XCONTEXT structure as parameter (see above
  2735.                    for a description of this mode).
  2736.         EXCF_LARGECONTEXT: The exception handler is called with a
  2737.                    EXCCONTEXT structure as parameter (see above
  2738.                    for a description of this mode).
  2739.  
  2740.                 One flag of EXCF_GLOBAL and EXCF_LOCAL and one
  2741.                 flag of EXCF_SMALLCONTEXT and EXCF_LARGECONTEXT
  2742.                 must be specified, otherwise this function
  2743.                 fails.
  2744.  
  2745.         EXCATTR_NAME:       An identification name for this handler
  2746.         EXCATTR_PRI:        The priority of this exception handler
  2747.  
  2748.     RESULT
  2749.     XLock - A lock to be passed to RemExcHandler or 0 if something
  2750.         failed.
  2751.  
  2752.     NOTES
  2753.     Exception handlers should generally take care that they don't
  2754.     destroy any registers of the interrupted task except if it is
  2755.     desired. Special care must be taken if the exception handler is
  2756.     called with the small context structure (take care of r0!). All
  2757.     registers, inclusive CR, CTR, LR and others must be restored if
  2758.     they should not be changed.
  2759.  
  2760.     IMPORTANT: The exception handler is called with MMU switched off!
  2761.     The whole address space is accessed in cachable copyback mode, so
  2762.     no access to critical locations such as custom chip space must
  2763.     be performed. If such locations should be accessed, a temporary
  2764.     MMU setup must be done using the library functions 'SetExcMMU'
  2765.     and 'ClearExcMMU' (V10)
  2766.  
  2767.     Note that changes to the MSR of the interrupted task must be done
  2768.     by writing to SRR1 (i.e. setting the trace bit).
  2769.  
  2770.     Note that exception handlers should generally not call system
  2771.     functions with some exceptions (for example 'SignalPPC' is often
  2772.     useful to call from exception handlers). System functions must not
  2773.     be called unless it's allowed explicitely by the documentation of
  2774.     each function.
  2775.  
  2776.     Note that the content of the program counter (SRR0) differs depending
  2777.     on the exception type. Sometimes it contains the address of the
  2778.     excepting instruction and sometimes the address of the next
  2779.     instruction to complete. Exception handlers must take care about
  2780.     this and should set the program counter appropriately.
  2781.     Here follows a table of all supported exceptions and their behaviour:
  2782.  
  2783.     Machine check (EXCF_MCHECK):        PC -> maybe next instruction
  2784.     Data access (EXCF_DACCESS):         PC -> excepting instruction
  2785.     Instruction access (EXCF_IACCESS):  PC -> next instruction
  2786.     Alignment (EXCF_ALIGN):             PC -> excepting instruction
  2787.     Program (EXCF_PROGRAM):             PC -> excepting instruction
  2788.     FP unavailable (EXCF_FPUN):         PC -> excepting instruction
  2789.     Trace (EXCF_TRACE):                 PC -> next instruction
  2790.     Performance Monitor (EXCF_PERFMON): unknown
  2791.     Instruction breakpoint (EXCF_IABR): PC -> excepting instruction
  2792.  
  2793.     Exception handlers should not waste stack space. The system
  2794.     allocates an extra space for this purpose but it may not be
  2795.     sufficient if very stack-intensive routines are called as
  2796.     exception handlers.
  2797.  
  2798.     If every exception handler returns the state EXCRETURN_NORMAL
  2799.     then the standard WarpOS exception handler is executed (except
  2800.     for Trace- and PerformanceMonitor-Exceptions).
  2801.  
  2802.     If exception handlers are written to emulate commands causing
  2803.     an exception they should return EXCRETURN_ABORT as return value
  2804.     to suppress following exception handlers which might output
  2805.     some alert messages. The priority should be probably high enough
  2806.     to ensure that no unwanted reactions occur.
  2807.  
  2808.     The WarpOS debugging system is disabled during exception
  2809.     processing.
  2810.  
  2811.     It's completely ILLEGAL to exit an exception handler by an RFI
  2812.     instruction!! It's also illegal to trash SPRG0!
  2813.  
  2814.     SEE ALSO
  2815.     RemExcHandler, powerpc/powerpc.i
  2816.  
  2817. powerpc.library/SetExcMMU                            powerpc.library/SetExcMMU
  2818.  
  2819.     NAME
  2820.     SetExcMMU - installs a BAT based MMU setup for exception handlers (V10)
  2821.  
  2822.     CPU
  2823.     PowerPC
  2824.  
  2825.     SYNOPSIS
  2826.     SetExcMMU(_PowerPCBase)
  2827.           r3
  2828.  
  2829.     void SetExcMMU(struct Library *);
  2830.  
  2831.     FUNCTION
  2832.     This function is for exception handlers only. It installs a new
  2833.     temporary MMU setup which allows exception handlers to access critical
  2834.     address space, such as custom chip space. Exception handlers are
  2835.     normally run with MMU switched off to avoid problems on systems
  2836.     without hardware tablesearch.
  2837.  
  2838.     The new MMU setup is based on the BAT registers.
  2839.  
  2840.     The function 'ClearExcMMU' restores the old MMU state and should
  2841.     be called at the end of the exception handler.
  2842.  
  2843.  
  2844.     INPUTS
  2845.     _PowerPCBase - base of powerpc.library
  2846.  
  2847.     NOTES
  2848.     This function must not be called from anywhere else than from
  2849.     an exception handler.
  2850.  
  2851.     SEE ALSO
  2852.     ClearExcMMU
  2853.  
  2854. powerpc.library/SetHardware                        powerpc.library/SetHardware
  2855.  
  2856.     NAME
  2857.     SetHardware - hardware manipulation function (V9)
  2858.  
  2859.     CPU
  2860.     PowerPC
  2861.  
  2862.     SYNOPSIS
  2863.     Status = SetHardware(_PowerPCBase, hardwareflags, parameter)
  2864.                  r3            r4             r5
  2865.  
  2866.     ULONG SetHardware(struct Library *, ULONG, void *);
  2867.  
  2868.     FUNCTION
  2869.     This function offers some functions to access the PPC hardware.
  2870.  
  2871.     INPUTS
  2872.     _PowerPCBase - base of powerpc.library
  2873.     hardwareflags - action to be performed:
  2874.         HW_TRACEON:         Enables trace mode for the current task
  2875.         HW_TRACEOFF:        Disables trace mode for the current task
  2876.         HW_BRANCHTRACEON:   Enables branch trace mode for the current task
  2877.         HW_BRANCHTRACEOFF:  Disables branch trace mode for the current task
  2878.         HW_FPEXCON:         Enables the floating point exceptions for the
  2879.                 current task
  2880.         HW_FPEXCOFF:        Disables the floating point exceptions for the
  2881.                 current task
  2882.         HW_SETIBREAK:       Sets the global instruction breakpoint
  2883.         HW_CLEARIBREAK:     Clears the global instruction breakpoint
  2884.         HW_SETDBREAK:       Sets the global data breakpoint
  2885.         HW_CLEARDBREAK:     Clears the global data breakpoint
  2886.  
  2887.     parameter - additional parameter only used if a breakpoint should be
  2888.             set. Then it contains the breakpoint address.
  2889.  
  2890.     RESULT
  2891.     Status - HW_AVAILABLE: The requested feature is available on this CPU
  2892.          HW_NOTAVAILABLE: The requested feature is not available on
  2893.                   this CPU
  2894.  
  2895.     NOTES
  2896.     Floating point exceptions are only enabled globally with HW_FPEXCON.
  2897.     It's necessary to call 'ModifyFPExc' to enable the desired floating
  2898.     point exceptions.
  2899.  
  2900.     Floating point exceptions should not be enabled by standard
  2901.     applications. They are intended to use for debugging purposes.
  2902.  
  2903.     The data breakpoint feature is not available on PPC603[E].
  2904.  
  2905.     SEE ALSO
  2906.     ModifyFPExc, powerpc/powerpc.i
  2907.  
  2908. powerpc.library/SetNiceValue                      powerpc.library/SetNiceValue
  2909.  
  2910.     NAME
  2911.     SetNiceValue - sets the NICE value of a task (V14)
  2912.  
  2913.     CPU
  2914.     PowerPC
  2915.  
  2916.     SYNOPSIS
  2917.     OldNice = SetNiceValue(_PowerPCBase, TaskPPC, Nice)
  2918.     r3                     r3            r4       r5
  2919.  
  2920.     LONG* SetNiceValue(struct Library *, struct TaskPPC *, LONG);
  2921.  
  2922.     FUNCTION
  2923.     This function can be used to set the NICE value of a task. The
  2924.     NICE value is a kind of priority, which replaces the old priority
  2925.     in LN_PRI. NICE values were introduced with the dynamic scheduler
  2926.     which works very differently than the old scheduler.
  2927.  
  2928.     If a task gets a high NICE value, it means that the task is nice
  2929.     to other tasks and won't request much CPU time. If a task gets
  2930.     a low NICE value, the opposite occurs. Using NICE values it is
  2931.     possible to affect execution speed of tasks.
  2932.  
  2933.     INPUTS
  2934.     _PowerPCBase - base of powerpc.library
  2935.     TaskPPC - pointer to the task which should be affected
  2936.     Nice - the NICE value (-20 ... 20)
  2937.  
  2938.     RESULT
  2939.     The old NICE value
  2940.  
  2941.     SEE ALSO
  2942.     SetTaskPriPPC, powerpc/tasksPPC.i, powerpc/tasksPPC.h
  2943.  
  2944. powerpc.library/SetReplyPortPPC                powerpc.library/SetReplyPortPPC
  2945.  
  2946.     NAME
  2947.     SetReplyPortPPC - exchanges the reply port of a message (V13)
  2948.  
  2949.     CPU
  2950.     PowerPC
  2951.  
  2952.     SYNOPSIS
  2953.     OldPort = SetReplyPortPPC(_PowerPCBase, Message, MsgPortPPC)
  2954.     r3                        r3            r4       r5
  2955.  
  2956.     struct MsgPortPPC* SetReplyPortPPC(struct Library *,
  2957.                struct Message *, struct MsgPortPPC *);
  2958.  
  2959.     FUNCTION
  2960.     This function exchanges the message port of a message. It
  2961.     can be used for internal PPC messages and for InterCPU
  2962.     messages.
  2963.  
  2964.     INPUTS
  2965.     _PowerPCBase - base of powerpc.library
  2966.     Message - a pointer to the message affected
  2967.     MsgPortPPC - a pointer to a PPC message port
  2968.  
  2969.     RESULT
  2970.     The old reply port, which was installed in the message.
  2971.     Can be NULL, of course.
  2972.  
  2973.     NOTES
  2974.     It's possible to specify NULL as MsgPort to remove the
  2975.     reply port.
  2976.  
  2977.     Don't poke into the message structure at MN_REPLYPORT,
  2978.     please use this function here.
  2979.  
  2980.     SEE ALSO
  2981.     WaitPortPPC, GetMsgPPC, ReplyMsgPPC, PutMsgPPC, powerpc/portsPPC.i
  2982.  
  2983. powerpc.library/SetScheduling                    powerpc.library/SetScheduling
  2984.  
  2985.     NAME
  2986.     SetScheduling - affects scheduling behaviour (V14)
  2987.  
  2988.     CPU
  2989.     PowerPC
  2990.  
  2991.     SYNOPSIS
  2992.     SetScheduling(_PowerPCBase, SchedTagList)
  2993.               r3            r4
  2994.  
  2995.     void SetScheduling(struct Library *, struct TagItem *);
  2996.  
  2997.     FUNCTION
  2998.     This function is used to set some scheduling parameters.
  2999.  
  3000.     INPUTS
  3001.     _PowerPCBase - base of powerpc.library
  3002.     SchedTagList - pointer to a tagitem array. The following tags are
  3003.                supported:
  3004.         SCHED_REACTION:     Sets the reaction time of low-activity tasks.
  3005.                 This value can be in range of (1..20). The
  3006.                 higher the value the more CPU time a
  3007.                 low-activity task gets (but which causes
  3008.                 longer blocking of busy tasks). Default is
  3009.                 currently 6.
  3010.  
  3011.     NOTES
  3012.     This function is safe to call from exception handlers.
  3013.  
  3014.     SEE ALSO
  3015.     powerpc/powerpc.i
  3016.  
  3017. powerpc.library/SetSignalPPC                      powerpc.library/SetSignalPPC
  3018.  
  3019.     NAME
  3020.     SetSignalPPC - define the state of this task's signals (V8)
  3021.  
  3022.     CPU
  3023.     PowerPC
  3024.  
  3025.     SYNOPSIS
  3026.     oldSignals = SetSignalPPC(_PowerPCBase, newSignals, signalMask)
  3027.     r3                        r3            r4          r5
  3028.  
  3029.     ULONG SetSignalPPC(struct Library *, ULONG, ULONG);
  3030.  
  3031.     FUNCTION
  3032.     This function can query or modify the state of the current
  3033.     signals. This function is the mirror function of exec/SetSignal.
  3034.  
  3035.     INPUTS
  3036.     _PowerPCBase - base of powerpc.library
  3037.     newSignals - the new values for the signals
  3038.     signalMask - the set of signals to be affected.
  3039.  
  3040.     RESULT
  3041.     oldSignals - the prior values for all signals
  3042.  
  3043.     NOTES
  3044.     It's possible to check for the system signals (i.e. CTRL_C).
  3045.  
  3046.     Before V11, this only worked if the task was stated using
  3047.     RunPPC, this is not the case anymore.
  3048.  
  3049.     SEE ALSO
  3050.     AllocSignalPPC, FreeSignalPPC, SignalPPC, WaitPPC
  3051.  
  3052. powerpc.library/SetTaskPriPPC                    powerpc.library/SetTaskPriPPC
  3053.  
  3054.     NAME
  3055.     SetTaskPriPPC - get and set the priority of a task (V8)
  3056.  
  3057.     CPU
  3058.     PowerPC
  3059.  
  3060.     SYNOPSIS
  3061.     oldpriority = SetTaskPriPPC(_PowerPCBase, taskPPC, priority)
  3062.     r3                          r3            r4       r5
  3063.  
  3064.     LONG SetTaskPriPPC(struct Library *, struct TaskPPC *, LONG);
  3065.  
  3066.     FUNCTION
  3067.     This function changes the priority of a task regardless of its
  3068.     state. The old priority of the task is returned. A reschedule
  3069.     may be performed. This is the mirror function of exec/SetTaskPri.
  3070.  
  3071.     Important: These task priorities are completely useless from V14
  3072.     on because of the new dynamic scheduler which uses NICE values
  3073.     instead of fixed priorities. Use 'SetNiceValue' to give tasks
  3074.     more or less CPU time.
  3075.  
  3076.     INPUTS
  3077.     _PowerPCBase - base of powerpc.library
  3078.     taskPPC - task to be affected
  3079.     priority - the new priority for the task
  3080.  
  3081.     RESULT
  3082.     old priority - the tasks previous priority
  3083.  
  3084.     SEE ALSO
  3085.     SetNiceValue
  3086.  
  3087. powerpc.library/Signal68K                            powerpc.library/Signal68K
  3088.  
  3089.     NAME
  3090.     SignalPPC - signal a 68K task (V8)
  3091.  
  3092.     CPU
  3093.     PowerPC
  3094.  
  3095.     SYNOPSIS
  3096.     Signal68K(_PowerPCBase, task, signals)
  3097.           r3            r4       r5
  3098.  
  3099.     void Signal68K(struct Library *, struct Task*, ULONG);
  3100.  
  3101.     FUNCTION
  3102.     This function signals a 68K task with the given signals. If
  3103.     the signalled task is sleeping, it's woken up and a reschedule
  3104.     may occur.
  3105.  
  3106.     INPUTS
  3107.     _PowerPCBase - base of powerpc.library
  3108.     task - the 68K task to be signalled
  3109.     signals - the signals to be sent
  3110.  
  3111. powerpc.library/SignalPPC                            powerpc.library/SignalPPC
  3112.  
  3113.     NAME
  3114.     SignalPPC - signal a task (V8)
  3115.  
  3116.     CPU
  3117.     PowerPC
  3118.  
  3119.     SYNOPSIS
  3120.     SignalPPC(_PowerPCBase, taskPPC, signals)
  3121.           r3            r4       r5
  3122.  
  3123.     void SignalPPC(struct Library *, struct TaskPPC*, ULONG);
  3124.  
  3125.     FUNCTION
  3126.     This function signals a task with the given signals. If the
  3127.     signalled task is sleeping, it's woken up and a reschedule
  3128.     may occur. This is the mirror function of exec/Signal.
  3129.  
  3130.     INPUTS
  3131.     _PowerPCBase - base of powerpc.library
  3132.     taskPPC - the task to be signalled
  3133.     signals - the signals to be sent
  3134.  
  3135.     NOTES
  3136.     This function is safe to call from exception handlers.
  3137.  
  3138.     Since V11 it's possible to signal a 68K task directly
  3139.     with 'SignalPPC' and the 68K task structure in r4.
  3140.  
  3141.     Before V11, 'SignalPPC' only worked, if the PPC task
  3142.     had a mirror 68K task. Since V11, every PPC task has
  3143.     a mirror task, so 'SignalPPC' can always be used.
  3144.  
  3145.     Furthermore, all signals, which are sent to a task currently
  3146.     waiting for its mirror task to complete, are transferred
  3147.     automatically to the mirror task. In fact, the whole signal
  3148.     system is shared and can be viewed as one single 'virtual
  3149.     signaling system'. It really doesn't matter, on which CPU
  3150.     a program is running, the signals are always transferred to
  3151.     the currently active part.
  3152.  
  3153.  
  3154.  
  3155.     SEE ALSO
  3156.     AllocSignalPPC, FreeSignalPPC, SetSignalPPC, WaitPPC
  3157.  
  3158. powerpc.library/SnoopTask                            powerpc.library/SnoopTask
  3159.  
  3160.     NAME
  3161.     SnoopTask - monitors beginning or end of a PPC task (V13)
  3162.  
  3163.     CPU
  3164.     PowerPC
  3165.  
  3166.     SYNOPSIS
  3167.     SnoopID = SnoopTask (_PowerPCBase, SnoopTags)
  3168.     r3                   r3            r4
  3169.  
  3170.     ULONG SnoopTask (struct Library *, struct TagItem *);
  3171.  
  3172.     FUNCTION
  3173.     This function allows to intall a callback job, which is executed
  3174.     when a new PPC task is started or when a PPC task is removed.
  3175.     This is useful for debuggers which want to be kept informed
  3176.     about new tasks installed into the system and about tasks removed
  3177.     from the system.
  3178.  
  3179.     The callback function has two different formats (prototypes),
  3180.     dependant on the type of callback:
  3181.  
  3182.     1. callback function for monitoring the beginning of a PPC task
  3183.        (SNOOP_TYPE = TASK_START)
  3184.  
  3185.        SYNOPSIS:
  3186.  
  3187.        CallbackFunction (PPCTask, EntryCode, CreatorTask, CreatorCPU)
  3188.                  r3       r4         r5           r6
  3189.  
  3190.        void CallbackFunction (struct TaskPPC *, APTR, struct Task *, ULONG);
  3191.  
  3192.        INPUTS:
  3193.        PPCTask - pointer to the new PPC task which is created
  3194.        EntryCode - pointer to the start code, which will be executed
  3195.                by the new task
  3196.        CreatorTask - pointer to the task structure of the task, which
  3197.              created the new PPC task. If the new task is created
  3198.              due to a call of RunPPC from 68K side, then the
  3199.              CreatorTask points to the 68K-Task-Structure. If
  3200.              the PPC task was created by directly calling
  3201.              'CreateTaskPPC', CreatorTask points to this PPC task.
  3202.        CreatorCPU - One of two possible values:
  3203.             CREATOR_PPC : The new PPC task was created using
  3204.                       'CreateTaskPPC' by a PPC task.
  3205.             CREATOR_68K : The new PPC task was created using
  3206.                       'RunPPC' by a 68K task.
  3207.  
  3208.  
  3209.     2. callback function for monitoring the end of a PPC task
  3210.        (SNOOP_TYPE = TASK_EXIT)
  3211.  
  3212.        SYNOPSIS:
  3213.  
  3214.        CallbackFunction (PPCTask)
  3215.                  r3
  3216.  
  3217.        void CallbackFunction (struct TaskPPC *);
  3218.  
  3219.        INPUTS:
  3220.        PPCTask - pointer to the PPC task which is removed. NEVER use
  3221.              FindTaskPPC(NULL), because it's possible that a PPC
  3222.              task is removed by another PPC task!
  3223.  
  3224.     INPUTS
  3225.     _PowerPCBase - base of powerpc.library
  3226.     TagItems - pointer to a tagitem array. The following tags are
  3227.            supported:
  3228.  
  3229.         SNOOP_CODE:         pointer to the callback function which should
  3230.                 be called, if a new PPC task is created or
  3231.                 if a PPC task is removed.
  3232.         SNOOP_DATA:         custom data which passed in register r2.
  3233.                 this will usually be the smalldata base of
  3234.                 the task which wants to snoop other tasks
  3235.                 to gain access to more data space.
  3236.         SNOOP_TYPE:         two possible values:
  3237.                 SNOOP_START : The callback function is called
  3238.                           when a new PPC task is created
  3239.                 SNOOP_EXIT  : The callback function is called
  3240.                           when a PPC task is removed
  3241.     RESULT
  3242.     SnoopID - An ID, which must be passed to EndSnoopTask, as soon as the
  3243.           snooping action should be terminated. NULL, if an error
  3244.           occurs.
  3245.  
  3246.     SEE ALSO
  3247.     EndSnoopTask
  3248.  
  3249. powerpc.library/SPrintF                                powerpc.library/SPrintF
  3250.  
  3251.     NAME
  3252.     SPrintF - prints a formatted string to the serial port (V7)
  3253.  
  3254.     CPU
  3255.     PowerPC
  3256.  
  3257.     SYNOPSIS
  3258.     SPrintF (_PowerPCBase, Formatstring, values )
  3259.          r3             r4             r5
  3260.  
  3261.     void SPrintF (struct Library *, STRPTR, APTR);
  3262.  
  3263.     FUNCTION
  3264.     Prints a formatted string to the serial port using the AMIGA-OS
  3265.     functions 'exec/RawPutChar' and 'exec/RawDoFmt'. Can be used to add
  3266.     debugging features and to improve the maintenance of software.
  3267.  
  3268.     INPUTS
  3269.     _PowerPCBase - base of powerpc.library
  3270.     Formatstring - A C style string with % commands to indicate where
  3271.                parameters have to be inserted (see 'exec/RawDoFmt'
  3272.                for a detailed description of these commands).
  3273.     values - A pointer to an array of parameters to be inserted into
  3274.          specified places in the string.
  3275.  
  3276.     SEE ALSO
  3277.     exec/RawDoFmt
  3278.  
  3279. powerpc.library/SubTimePPC                          powerpc.library/SubTimePPC
  3280.  
  3281.     NAME
  3282.     SubTimePPC - subtracts one time request from another (V7)
  3283.  
  3284.     CPU
  3285.     PowerPC
  3286.  
  3287.     SYNOPSIS
  3288.     SubTimePPC(_PowerPCBase, Dest, Source)
  3289.            r3            r4    r5
  3290.  
  3291.     void SubTimePPC(struct Library *, struct timeval *, struct timeval *);
  3292.  
  3293.     FUNCTION
  3294.     This routine subtracts one timeval structure from another. The results
  3295.     are stored in the destination (Dest - Source -> Dest)
  3296.  
  3297.     This is the mirror function of timer/SubTime.
  3298.  
  3299.     INPUTS
  3300.     _PowerPCBase - base of powerpc.library
  3301.     Dest - pointer to a timeval structure
  3302.     Source - pointer to a timeval structure
  3303.  
  3304.     NOTES
  3305.     This function is safe to call from exception handlers
  3306.  
  3307.     SEE ALSO
  3308.     GetSysTimePPC, AddTimePPC, CmpTimePPC
  3309.  
  3310. powerpc.library/Super                                    powerpc.library/Super
  3311.  
  3312.     NAME
  3313.     Super - switch to supervisor mode (V9)
  3314.  
  3315.     CPU
  3316.     PowerPC
  3317.  
  3318.     SYNOPSIS
  3319.     SuperKey = Super(_PowerPCBase)
  3320.     r3               r3
  3321.  
  3322.     ULONG Super(struct Library *);
  3323.  
  3324.     FUNCTION
  3325.     This function changes the current task to supervisor mode.
  3326.  
  3327.     INPUTS
  3328.     _PowerPCBase - base of powerpc.library
  3329.  
  3330.     RESULT
  3331.     SuperKey - A key value which must be passed to 'User' to switch back
  3332.            to user mode
  3333.  
  3334.     NOTES
  3335.     Applications should generally not enter supervisor mode. Check first
  3336.     if there exists a library function which gives you access to the
  3337.     supervisor resources required.
  3338.  
  3339.     SEE ALSO
  3340.     User
  3341.  
  3342. powerpc.library/UnLockTaskList                  powerpc.library/UnLockTaskList
  3343.  
  3344.     NAME
  3345.     UnLockTaskList - unlocks a list locked by LockTaskList (V10)
  3346.  
  3347.     CPU
  3348.     PowerPC
  3349.  
  3350.     SYNOPSIS
  3351.     UnLockTaskList(_PowerPCBase)
  3352.                r3
  3353.  
  3354.     void UnLockTaskList(struct Library *);
  3355.  
  3356.     FUNCTION
  3357.     Unlocks the task list which was locked by LockTaskList
  3358.  
  3359.     INPUTS
  3360.     _PowerPCBase - base of powerpc.library
  3361.  
  3362.     SEE ALSO
  3363.     LockTaskList, powerpc/tasksppc.i
  3364.  
  3365. powerpc.library/User                                      powerpc.library/User
  3366.  
  3367.     NAME
  3368.     User - switch to user mode (V9)
  3369.  
  3370.     CPU
  3371.     PowerPC
  3372.  
  3373.     SYNOPSIS
  3374.     User(_PowerPCBase, SuperKey)
  3375.          r3            r4
  3376.  
  3377.     void User(struct Library *, ULONG);
  3378.  
  3379.     FUNCTION
  3380.     This function changes the current task to user mode.
  3381.  
  3382.     INPUTS
  3383.     _PowerPCBase - base of powerpc.library
  3384.     SuperKey - The return value of the matching call of 'Super'
  3385.  
  3386.     SEE ALSO
  3387.     Super
  3388.  
  3389. powerpc.library/WaitFor68K                          powerpc.library/WaitFor68K
  3390.  
  3391.     NAME
  3392.     WaitFor68K - waits for the completion of an asynchrone 68K call (V7)
  3393.  
  3394.     CPU
  3395.     PowerPC
  3396.  
  3397.     SYNOPSIS
  3398.     status = WaitFor68K(_PowerPCBase, PPStruct )
  3399.     r3                  r3             r4
  3400.  
  3401.     LONG WaitFor68K (struct Library *, struct PowerPC *);
  3402.  
  3403.     FUNCTION
  3404.     After an asynchrone 68K call was done (see Run68K) this function must
  3405.     be called to wait for the completion of the 68K function. All
  3406.     registers transferred to the PowerPC with Run68K are returned into the
  3407.     PowerPC Structure.
  3408.  
  3409.     INPUTS
  3410.     _PowerPCBase - base of powerpc.library
  3411.     PPStruct - Pointer to a PowerPC Structure (see Run68K for a description
  3412.            of the elements). The structure has not to be initialized.
  3413.            The structure must be transferred to hold the returned
  3414.            registers by the 68K function.
  3415.  
  3416.     RESULT
  3417.     status - PPERR_SUCCESS if the call was successfully
  3418.          PPERR_WAITERR if WaitFor68K is called after a synchrone 68K
  3419.                    call.
  3420.  
  3421.     NOTES
  3422.     Assembler programmers should use the macros WAITFOR68K and
  3423.     WAITFOR68K_XL located in the include file 'powerpc/powerpc.i'
  3424.  
  3425.     SEE ALSO
  3426.     Run68K,powerpc/powerpc.i
  3427.  
  3428. powerpc.library/WaitPortPPC                        powerpc.library/WaitPortPPC
  3429.  
  3430.     NAME
  3431.     WaitPortPPC - wait for a given port to be non-empty (V11)
  3432.  
  3433.     CPU
  3434.     PowerPC
  3435.  
  3436.     SYNOPSIS
  3437.     message = WaitPortPPC(_PowerPCBase, MsgPortPPC)
  3438.     r3                    r3            r4
  3439.  
  3440.     struct Message *WaitPortPPC(struct Library *, struct MsgPortPPC *);
  3441.  
  3442.     FUNCTION
  3443.     This function waits until the given port becomes non-empty. The
  3444.     first message in the port is returned without removing it from
  3445.     the port. This is the mirror function of exec/WaitPort.
  3446.  
  3447.     INPUTS
  3448.     _PowerPCBase - base of powerpc.library
  3449.     port - a pointer to a message port
  3450.  
  3451.     RESULTS
  3452.     message - a pointer to the first available message
  3453.  
  3454.     SEE ALSO
  3455.     PutMsgPPC, GetMsgPPC, ReplyMsgPPC, powerpc/portsPPC.i
  3456.  
  3457. powerpc.library/WaitPPC                                powerpc.library/WaitPPC
  3458.  
  3459.     NAME
  3460.     WaitPPC - wait for one or more signals (V8)
  3461.  
  3462.     CPU
  3463.     PowerPC
  3464.  
  3465.     SYNOPSIS
  3466.     signals = WaitPPC(_PowerPCBase, signalSet)
  3467.     r3                r3            r4
  3468.  
  3469.     ULONG WaitPPC(struct Library *, ULONG);
  3470.  
  3471.     FUNCTION
  3472.     This function attempts to wait for the given signals. If at
  3473.     least one of these signal is already set, the task returns
  3474.     immediately, otherwise it changes to waiting state. This is
  3475.     the mirror function of exec/Wait.
  3476.  
  3477.     INPUTS
  3478.     _PowerPCBase - base of powerpc.library
  3479.     signalSet - the set of signals for which to wait
  3480.  
  3481.     RESULTS
  3482.     signals - the signals which were received
  3483.  
  3484.     NOTES
  3485.     Since V11 it's possible to wait for signals which might
  3486.     be sent by 68K tasks (and maybe only to the mirror 68K
  3487.     task of this PPC task here). Calling exec/Signal with a
  3488.     PPC task structure as first argument will work, too.
  3489.     See the desription of 'SignalPPC' for more information
  3490.     about the shared signaling system.
  3491.  
  3492.     SEE ALSO
  3493.     AllocSignalPPC, FreeSignalPPC, SetSignalPPC, SignalPPC
  3494.  
  3495. powerpc.library/WaitTime                              powerpc.library/WaitTime
  3496.  
  3497.     NAME
  3498.     WaitTime - wait for a given time or for given signals (V10)
  3499.  
  3500.     CPU
  3501.     PowerPC
  3502.  
  3503.     SYNOPSIS
  3504.     signals = WaitTime(_PowerPCBase, signalSet, time)
  3505.     r3                 r3            r4         r5
  3506.  
  3507.     ULONG WaitTime(struct Library *, ULONG, ULONG);
  3508.  
  3509.     FUNCTION
  3510.     This function attempts to wait for a specific time of for
  3511.     given signals. This function acts just like 'WaitPPC' with
  3512.     the difference that the task returns when the time specified
  3513.     is over.
  3514.  
  3515.     INPUTS
  3516.     _PowerPCBase - base of powerpc.library
  3517.     signalSet - the set of signals for which to wait (can be 0
  3518.             if the task should only wait for a given time)
  3519.     time - the time in microseconds to wait
  3520.  
  3521.     RESULTS
  3522.     signals - the signals which were received (if this value is 0,
  3523.           then the time is up).
  3524.  
  3525.     NOTES
  3526.     The time which explicitly passes between calling 'WaitTime' and
  3527.     returning from it can vary dependant of current system state. If
  3528.     many tasks are active, the time can be delayed. Furthermore the
  3529.     overhead of this function must be taken in account.
  3530.  
  3531.     SEE ALSO
  3532.     WaitPPC
  3533.  
  3534.  
  3535.